Copyright 2001 Prentice-Hall, Inc. Object Oriented Aproach to System Requirements: Process Modeling...

52
Copyright 2001 Prentice-Hall, Copyright 2001 Prentice-Hall, Inc. Inc. Object Oriented Aproach Object Oriented Aproach to System Requirements: to System Requirements: Process Modeling Process Modeling 7.1 Chapter 7

Transcript of Copyright 2001 Prentice-Hall, Inc. Object Oriented Aproach to System Requirements: Process Modeling...

Copyright 2001 Prentice-Hall, Inc. Copyright 2001 Prentice-Hall, Inc.

Object Oriented Aproach Object Oriented Aproach to System Requirements:to System Requirements:

Process ModelingProcess Modeling

7.17.1

Chapter 7Chapter 7

Process ModelingProcess Modeling

Graphically represent the processes Graphically represent the processes that capture, manipulate, store and that capture, manipulate, store and distribute data between a system distribute data between a system and its environment and among and its environment and among system componentssystem components

Data flow diagrams (DFD)Data flow diagrams (DFD)– Graphically illustrate movement of data Graphically illustrate movement of data

between external entities and the between external entities and the processes and data stores within a processes and data stores within a systemsystem

7.27.2

Process ModelingProcess Modeling

Modeling a system’s processModeling a system’s process– Utilize information gathered during Utilize information gathered during

requirements determinationrequirements determination– Structure of the data is also modeled in Structure of the data is also modeled in

addition to the processesaddition to the processes Deliverables and OutcomesDeliverables and Outcomes

– Set of coherent, interrelated data flow Set of coherent, interrelated data flow diagramsdiagrams

7.37.3

Process ModelingProcess Modeling

Deliverables and outcomes Deliverables and outcomes (continued)(continued)– Context data flow diagram (DFD)Context data flow diagram (DFD)

Scope of systemScope of system

– DFDs of current systemDFDs of current systemEnables analysts to understand current Enables analysts to understand current

systemsystem

– DFDs of new logical systemDFDs of new logical systemTechnology independentTechnology independentShow data flows, structure and functional Show data flows, structure and functional

requirements of new systemrequirements of new system7.47.4

Process ModelingProcess Modeling

Deliverables and outcomes Deliverables and outcomes (continued)(continued)– Project dictionary and CASE repositoryProject dictionary and CASE repository

Data flow diagramming mechanicsData flow diagramming mechanics– Four symbols are usedFour symbols are used

Square, Rounded Rectangle, Open-ended Square, Rounded Rectangle, Open-ended Rectangle, Flow arrowRectangle, Flow arrow

– Developed by DeMarco and YourdanDeveloped by DeMarco and Yourdan

7.57.5

Data Flow Diagramming Data Flow Diagramming MechanicsMechanics

Data FlowData Flow– Depicts data that are in motion and Depicts data that are in motion and

moving as a unit from one place to moving as a unit from one place to another in the system.another in the system.

– Drawn as an arrowDrawn as an arrow– Select a meaningful name to represent Select a meaningful name to represent

the datathe data

7.67.6

Data Flow Diagramming Data Flow Diagramming MechanicsMechanics

Data StoreData Store– Depicts data at restDepicts data at rest– May represent data inMay represent data in

File folderFile folderComputer-based fileComputer-based fileNotebookNotebook

– Drawn as two horizontal parallel linesDrawn as two horizontal parallel lines– The name of the store as well as the The name of the store as well as the

number are recorded in between linesnumber are recorded in between lines

Data Flow Diagramming Data Flow Diagramming MechanicsMechanics

ProcessProcess– Depicts work or action performed on Depicts work or action performed on

data so that they are transformed, data so that they are transformed, stored or distributedstored or distributed

– Drawn as a circleDrawn as a circle– Number of process as well as name are Number of process as well as name are

recordedrecorded

7.87.8

Data Flow Diagramming Data Flow Diagramming MechanicsMechanics

Source/SinkSource/Sink– Depicts the origin and/or destination of Depicts the origin and/or destination of

the datathe data– Sometimes referred to as an external Sometimes referred to as an external

entityentity– Drawn as a square symbolDrawn as a square symbol– Name states what the external agent isName states what the external agent is– Because they are external, many Because they are external, many

characteristics are not of interest to uscharacteristics are not of interest to us

7.97.9

Data Flow Diagramming Data Flow Diagramming DefinitionsDefinitions

Context DiagramContext Diagram– A data flow diagram (DFD) of the scope of an A data flow diagram (DFD) of the scope of an

organizational system that shows the system organizational system that shows the system boundaries, external entities that interact with boundaries, external entities that interact with the system and the major information flows the system and the major information flows between the entities and the systembetween the entities and the system

Level-O DiagramLevel-O Diagram– A data flow diagrams (DFD) that represents a A data flow diagrams (DFD) that represents a

system’s major processes, data flows and data system’s major processes, data flows and data stores at a higher levelstores at a higher level

7.107.10

Developing DFDs: An ExampleDeveloping DFDs: An Example

Context Diagram contains no data Context Diagram contains no data storesstores

Next step is to expand the context Next step is to expand the context diagram to show the breakdown of diagram to show the breakdown of processesprocesses

7.117.11

Data Flow Diagramming RulesData Flow Diagramming Rules

Basic rules that apply to all DFDsBasic rules that apply to all DFDs– Inputs to a process are always different Inputs to a process are always different

than outputsthan outputs– Objects always have a unique nameObjects always have a unique name

In order to keep the diagram uncluttered, In order to keep the diagram uncluttered, you can repeat data stores and data flows you can repeat data stores and data flows on a diagramon a diagram

7.127.12

Data Flow Diagramming RulesData Flow Diagramming Rules

ProcessProcessA.A. No process can No process can

have only outputs have only outputs (a miracle)(a miracle)

B.B. No process can No process can have only inputs have only inputs (black hole)(black hole)

C.C. A process has a A process has a verb phrase labelverb phrase label

Data StoreData StoreD.D. Data cannot be moved Data cannot be moved

from one store to from one store to another.another.

E.E. Data cannot move Data cannot move from an outside source from an outside source to a data storeto a data store

F.F. Data cannot move Data cannot move directly from a data directly from a data store to a data sinkstore to a data sink

G.G. Data store has a noun Data store has a noun phrase labelphrase label

7.137.13

Data Flow Diagramming RulesData Flow Diagramming Rules

Source/SinkSource/SinkH.H. Data cannot move Data cannot move

directly from a directly from a source to a sinksource to a sink

I.I. A source/sink has A source/sink has a noun phrase a noun phrase labellabel

Data FlowData FlowJ.J. A data flow has only A data flow has only

one direction of flow one direction of flow between symbols.between symbols.

K.K. A fork means that A fork means that exactly the same data exactly the same data go from a common go from a common location to two or more location to two or more processes, data stores processes, data stores or sources/sinksor sources/sinks

7.147.14

Data Flow Diagramming RulesData Flow Diagramming Rules

Data Flow (Continued)Data Flow (Continued)L.L. A join means that exactly the same data A join means that exactly the same data

come from any two or more different come from any two or more different processes, data stores or sources/sinks to a processes, data stores or sources/sinks to a common locationcommon location

M.M. A data flow cannot go directly back to the A data flow cannot go directly back to the same process it leavessame process it leaves

N.N. A data flow to a data store means updateA data flow to a data store means updateO.O. A data flow from a data store means retrieve A data flow from a data store means retrieve

or useor useP.P. A data flow has a noun phrase labelA data flow has a noun phrase label

7.157.15

Decomposition of DFDsDecomposition of DFDs

Functional decompositionFunctional decomposition– Act of going from one single system to many Act of going from one single system to many

component processescomponent processes– Repetitive procedureRepetitive procedure– Lowest level is called a primitive DFDLowest level is called a primitive DFD

Level-N DiagramsLevel-N Diagrams– A DFD that is the result of A DFD that is the result of nn nested nested

decompositions of a series of subprocesses decompositions of a series of subprocesses from a process on a level-0 diagramfrom a process on a level-0 diagram

7.167.16

Balancing DFDsBalancing DFDs

When decomposing a DFD, you must When decomposing a DFD, you must conserve inputs to and outputs from a conserve inputs to and outputs from a process at the next level of decompositionprocess at the next level of decomposition

This is called balancingThis is called balancing

7.177.17

Guidelines for Drawing DFDsGuidelines for Drawing DFDs

1.1. CompletenessCompleteness– DFD must include all components necessary DFD must include all components necessary

for systemfor system– Each component must be fully described in Each component must be fully described in

the project dictionary or CASE repositorythe project dictionary or CASE repository

2.2. ConsistencyConsistency– The extent to which information contained on The extent to which information contained on

one level of a set of nested DFDs is also one level of a set of nested DFDs is also included on other levelsincluded on other levels

7.187.18

Guidelines for Drawing DFDsGuidelines for Drawing DFDs

3.3. TimingTiming– Time is not represented well on DFDsTime is not represented well on DFDs– Best to draw DFDs as if the system has Best to draw DFDs as if the system has

never started and will never stop.never started and will never stop.

4.4. Iterative DevelopmentIterative Development– Analyst should expect to redraw Analyst should expect to redraw

diagram several times before reaching diagram several times before reaching the closest approximation to the the closest approximation to the system being modeledsystem being modeled

7.197.19

Guidelines for Drawing DFDsGuidelines for Drawing DFDs

5.5. Primitive DFDsPrimitive DFDs– Lowest logical level of decompositionLowest logical level of decomposition– Decision has to be made when to stop Decision has to be made when to stop

decompositiondecomposition

7.207.20

Guidelines for Drawing DFDsGuidelines for Drawing DFDs

Rules for stopping decompositionRules for stopping decomposition– When each process has been reduced to When each process has been reduced to

a single decision, calculation or a single decision, calculation or database operationdatabase operation

– When each data store represents data When each data store represents data about a single entityabout a single entity

– When the system user does not care to When the system user does not care to see any more detailsee any more detail

7.217.21

Guidelines for Drawing DFDsGuidelines for Drawing DFDs

Rules for stopping decomposition Rules for stopping decomposition (continued)(continued)– When every data flow does not need to be split When every data flow does not need to be split

further to show that data are handled in further to show that data are handled in various waysvarious ways

– When you believe that you have shown each When you believe that you have shown each business form or transaction, on-line display business form or transaction, on-line display and report as a single data flowand report as a single data flow

– When you believe that there is a separate When you believe that there is a separate process for each choice on all lowest-level process for each choice on all lowest-level menu optionsmenu options

7.227.22

Using DFDs as Analysis ToolsUsing DFDs as Analysis Tools

Gap AnalysisGap Analysis– The process of discovering discrepancies The process of discovering discrepancies

between two or more sets of data flow between two or more sets of data flow diagrams or discrepancies within a diagrams or discrepancies within a single DFDsingle DFD

Inefficiencies in a system can often Inefficiencies in a system can often be identified through DFDsbe identified through DFDs

7.237.23

Logic ModelingLogic Modeling

Data flow diagrams do not show the Data flow diagrams do not show the logic inside the processeslogic inside the processes

Logic modeling involves representing Logic modeling involves representing internal structure and functionality of internal structure and functionality of processes depicted on a DFDprocesses depicted on a DFD

Two methodsTwo methods– Structured EnglishStructured English– Decision TablesDecision Tables

7.247.24

Modeling Logic with Structured Modeling Logic with Structured EnglishEnglish

Modified form of English used to Modified form of English used to specify the logic of information specify the logic of information processesprocesses

Uses a subset of EnglishUses a subset of English– Action verbsAction verbs– Noun phrasesNoun phrases– No adjectives or adverbsNo adjectives or adverbs

No specific standardsNo specific standards

7.257.25

Modeling Logic with Structured Modeling Logic with Structured EnglishEnglish

Similar to programming languageSimilar to programming language– If conditionsIf conditions– Case statementsCase statements

7.267.26

Modeling Logic withModeling Logic with Decision Tables Decision Tables

A matrix representation of the logic A matrix representation of the logic of a decisionof a decision

Specifies the possible conditions and Specifies the possible conditions and the resulting actionsthe resulting actions

Best used for complicated decision Best used for complicated decision logiclogic

7.277.27

Modeling Logic withModeling Logic withDecision TablesDecision Tables

Consists of three partsConsists of three parts– Condition stubsCondition stubs

Lists condition relevant to decisionLists condition relevant to decision

– Action stubsAction stubsActions that result for a given set of Actions that result for a given set of

conditionsconditions

– RulesRulesSpecify which actions are to be followed for Specify which actions are to be followed for

a given set of conditionsa given set of conditions

7.287.28

Modeling Logic withModeling Logic with Decision Tables Decision Tables

Indifferent ConditionIndifferent Condition– Condition whose value does not affect which Condition whose value does not affect which

action is taken for two or more rulesaction is taken for two or more rules Standard procedure for creating decision Standard procedure for creating decision

tablestables– Name the condition and values each condition Name the condition and values each condition

can assumecan assume– Name all possible actions that can occurName all possible actions that can occur– List all rulesList all rules– Define the actions for each ruleDefine the actions for each rule– Simplify the tableSimplify the table

7.297.29

SummarySummary

Data flow diagrams (DFD)Data flow diagrams (DFD)– SymbolsSymbols– Rules for creatingRules for creating– DecompositionDecomposition– BalancingBalancing

DFDs for AnalysisDFDs for Analysis DFDs for Business Process DFDs for Business Process

Reengineering (BPR)Reengineering (BPR)

7.307.30

SummarySummary

Logic ModelingLogic Modeling– Structured EnglishStructured English– Decision TablesDecision Tables

7.317.31

Copyright 2001 Prentice-Hall, Inc. Copyright 2001 Prentice-Hall, Inc.

Conceptual Data Conceptual Data ModelingModeling

The ER ModelThe ER Model

7.347.34

Learning ObjectivesLearning Objectives

Define key data-modeling termsDefine key data-modeling termsConceptual data modelConceptual data modelEntity-Relationship (E-R) diagram Entity-Relationship (E-R) diagram Entity typeEntity typeEntity instanceEntity instanceAttributeAttributeCandidate keyCandidate keyMultivalued attributesMultivalued attributesRelationshipRelationshipDegreeDegreeCardinalityCardinalityAssociative entityAssociative entity

7.357.35

Learning ObjectivesLearning Objectives

Ask the right kinds of questions to determine Ask the right kinds of questions to determine data requirements for an ISdata requirements for an IS

Learn to draw Entity-Relationship Diagrams Learn to draw Entity-Relationship Diagrams (ERD)(ERD)

Review the role of conceptual data modeling Review the role of conceptual data modeling in overall design and analysis of an in overall design and analysis of an information systeminformation system

Discuss relationships and associative entitiesDiscuss relationships and associative entities

Discuss relationship between data modeling Discuss relationship between data modeling and process modeling and process modeling

7.347.34

Conceptual Data ModelingConceptual Data Modeling Representation of organizational dataRepresentation of organizational data Purpose is to show rules about the meaning and Purpose is to show rules about the meaning and

interrelationships among datainterrelationships among data Entity-Relationship (E-R) diagrams are commonly Entity-Relationship (E-R) diagrams are commonly

used to show how data are organizedused to show how data are organized Main goal of conceptual data modeling is to Main goal of conceptual data modeling is to

create accurate E-R diagramscreate accurate E-R diagrams Methods such as interviewing, questionnaires and Methods such as interviewing, questionnaires and

JAD are used to collect informationJAD are used to collect information Consistency must be maintained between Consistency must be maintained between

process flow, decision logic and data modeling process flow, decision logic and data modeling descriptionsdescriptions

7.357.35

Process of Conceptual Data Process of Conceptual Data ModelingModeling

First step is to develop a data model for First step is to develop a data model for the system being replacedthe system being replaced

Next, a new conceptual data model is built Next, a new conceptual data model is built that includes all the requirements of the that includes all the requirements of the new systemnew system

In the design stage, the conceptual data In the design stage, the conceptual data model is translated into a physical designmodel is translated into a physical design

Project repository links all design and data Project repository links all design and data modeling steps performed during SDLCmodeling steps performed during SDLC

7.367.36

Deliverables and OutcomeDeliverables and Outcome

Primary deliverable is the entity-Primary deliverable is the entity-relationship diagramrelationship diagram

There may be as many as 4 E-R diagrams There may be as many as 4 E-R diagrams produced and analyzed during conceptual produced and analyzed during conceptual data modelingdata modeling– Covers just data needed in the project’s Covers just data needed in the project’s

applicationapplication– E-R diagram for system being replacedE-R diagram for system being replaced– An E-R diagram for the whole database from An E-R diagram for the whole database from

which the new application’s data are extractedwhich the new application’s data are extracted– An E-R diagram for the whole database from An E-R diagram for the whole database from

which data for the application system being which data for the application system being replaced are drawnreplaced are drawn

7.377.37

Deliverables and OutcomeDeliverables and Outcome

Second deliverable is a set of entries Second deliverable is a set of entries about data objects to be stored in about data objects to be stored in repository or project dictionaryrepository or project dictionary– Repository links data, process and logic models Repository links data, process and logic models

of an information systemof an information system– Data elements that are included in the DFD Data elements that are included in the DFD

must appear in the data model and converselymust appear in the data model and conversely– Each data store in a process model must relate Each data store in a process model must relate

to business objects represented in the data to business objects represented in the data modelmodel

7.387.38

Gathering Information for Gathering Information for Conceptual Data ModelingConceptual Data Modeling

Two perspectivesTwo perspectives– Top-downTop-down

Data model is derived from an intimate Data model is derived from an intimate understanding of the businessunderstanding of the business

– Bottom-upBottom-upData model is derived by reviewing Data model is derived by reviewing

specifications and business documentsspecifications and business documents

7.397.39

Introduction to Entity-Introduction to Entity-Relationship (E-R) ModelingRelationship (E-R) Modeling

Notation uses three main constructsNotation uses three main constructs– Data entitiesData entities– RelationshipsRelationships– AttributesAttributes

Entity-Relationship (E-R) DiagramEntity-Relationship (E-R) Diagram– A detailed, logical and graphical A detailed, logical and graphical

representation of the entities, representation of the entities, associations and data elements for an associations and data elements for an organization or businessorganization or business

7.407.40

Entity-Relationship (E-R) Entity-Relationship (E-R) ModelingModelingKey TermsKey Terms EntityEntity

– A person, place, object, event or concept in the A person, place, object, event or concept in the user environment about which the organization user environment about which the organization wishes to maintain datawishes to maintain data

– Represented by a rectangle in E-R diagramsRepresented by a rectangle in E-R diagrams Entity TypeEntity Type

– A collection of entities that share common A collection of entities that share common properties or characteristicproperties or characteristic

AttributeAttribute– A named property or characteristic of an entity A named property or characteristic of an entity

that is of interest to an organizationthat is of interest to an organization

7.417.41

Entity-Relationship (E-R) Entity-Relationship (E-R) ModelingModelingKey TermsKey Terms

Candidate keys and identifiersCandidate keys and identifiers– Each entity type must have an attribute Each entity type must have an attribute

or set of attributes that distinguishes or set of attributes that distinguishes one instance from other instances of the one instance from other instances of the same typesame type

– Candidate keyCandidate keyAttribute (or combination of attributes) that Attribute (or combination of attributes) that

uniquely identifies each instance of an entity uniquely identifies each instance of an entity typetype

7.427.42

Entity-Relationship (E-R) Entity-Relationship (E-R) ModelingModelingKey TermsKey Terms

IdentifierIdentifier– A candidate key that has been selected as the A candidate key that has been selected as the

unique identifying characteristic for an entity unique identifying characteristic for an entity typetype

– Selection rules for an identifierSelection rules for an identifier Choose a candidate key that will not change its Choose a candidate key that will not change its

valuevalue Choose a candidate key that will never be nullChoose a candidate key that will never be null Avoid using intelligent keysAvoid using intelligent keys Consider substituting single value surrogate keys for Consider substituting single value surrogate keys for

large composite keyslarge composite keys

7.437.43

Entity-Relationship (E-R) Entity-Relationship (E-R) ModelingModelingKey TermsKey Terms

Multivalued AttributeMultivalued Attribute– An attribute that may take on more than An attribute that may take on more than

one value for each entity instanceone value for each entity instance– Represented on E-R Diagram in two Represented on E-R Diagram in two

ways:ways:double-lined ellipsedouble-lined ellipseweak entityweak entity

7.447.44

Entity-Relationship (E-R) Entity-Relationship (E-R) ModelingModelingKey TermsKey Terms RelationshipRelationship

– An association between the instances of An association between the instances of one or more entity types that is of one or more entity types that is of interest to the organizationinterest to the organization

– Association indicates that an event has Association indicates that an event has occurred or that there is a natural link occurred or that there is a natural link between entity typesbetween entity types

– Relationships are always labeled with Relationships are always labeled with verb phrasesverb phrases

7.457.45

Conceptual Data Modeling and Conceptual Data Modeling and the E-R Diagramthe E-R Diagram

GoalGoal– Capture as much of the meaning of the data as Capture as much of the meaning of the data as

possiblepossible ResultResult

– A better design that is easier to maintainA better design that is easier to maintain

7.467.46

Degree of RelationshipDegree of Relationship

DegreeDegree– Number of entity types that participate in a Number of entity types that participate in a

relationshiprelationship Three casesThree cases

– UnaryUnary A relationship between the instances of one entity typeA relationship between the instances of one entity type

– BinaryBinary A relationship between the instances of two entity typesA relationship between the instances of two entity types

– TernaryTernary A simultaneous relationship among the instances of three A simultaneous relationship among the instances of three

entity typesentity types Not the same as three binary relationshipsNot the same as three binary relationships

7.477.47

CardinalityCardinality

The number of instances of entity B that can The number of instances of entity B that can be associated with each instance of entity Abe associated with each instance of entity A

Minimum CardinalityMinimum Cardinality– The minimum number of instances of entity B The minimum number of instances of entity B

that may be associated with each instance of that may be associated with each instance of entity Aentity A

Maximum CardinalityMaximum Cardinality– The maximum number of instances of entity B The maximum number of instances of entity B

that may be associated with each instance of that may be associated with each instance of entity Aentity A

7.487.48

Associative EntityAssociative Entity

An entity type that associates the An entity type that associates the instances of one or more entity types instances of one or more entity types and contains attributes that are and contains attributes that are peculiar to the relationship between peculiar to the relationship between those entity instancesthose entity instances

7.497.49

Internet Development: Internet Development: Conceptual Data ModelConceptual Data Model

Conceptual data modeling for Internet Conceptual data modeling for Internet applications is no different than the applications is no different than the processed followed for other types of processed followed for other types of applicationsapplications

Pine Valley Furniture WebStorePine Valley Furniture WebStore– Four entity types definedFour entity types defined

CustomerCustomer InventoryInventory OrderOrder Shopping cartShopping cart

7.507.50

SummarySummary

Process of conceptual data modelingProcess of conceptual data modeling– DeliverablesDeliverables– Gathering informationGathering information

Entity-Relationship ModelingEntity-Relationship Modeling– EntitiesEntities– AttributesAttributes– Candidate keys and identifiersCandidate keys and identifiers– Multivalued attributesMultivalued attributes

Degree of relationshipDegree of relationship

7.517.51

SummarySummary

CardinalityCardinality Associative entitiesAssociative entities Conceptual data modeling and Conceptual data modeling and

Internet developmentInternet development

7.527.52