You are on page 1of 106

Data Flow Diagrams (DFDs)

Data Flow Diagrams (DFDs)

Data flow diagram (DFD) is a picture of the movement of data between external entities and the processes and data stores within a system

'rder C)!+'$,!tatus $essage !tatus Data ".0 !hipping Confirmation #ssue !tatus $essages D1

#n3!toc -e4uest

1.0 Chec !tatus 'rder Data 2ending 'rders

'rder Data 2ayment #nvoice 0.0 'rder Data $anage (ccounts -eceivable (ccounts -eceivable Data (ccounts -eceivable #nventory -eports

(ccounting Data

D"

DFD !ymbols (&ane 5 !arson)


2rocess Data Flow Data !tore !ource6!in (,xternal ,ntity)

2rocess
1.0
&rade Detail

&rade -eport

2roduce &rade -eport


.or or actions performed on data (inside the system) 7abels should be verb phrases -eceives input data and produces output

-ule 18 2rocess

Can have more than one outgoing data flow or more than one incoming data flow
1.0

!ubmitted .or

&raded .or !tudent &rade

&rade !tudent .or

/ours .or ed 2ay -ate

%.0

&ross 2ay
Calculated &ross 2ay

-ule "8 2rocess

Can connect to any other symbol (including another process symbol)

'rder

1.0 9erify 'rder

(ccepted 'rder

".0 (ssemble 'rder

#nventory Change

2rocess8 Correct6#ncorrect:
!ervices 2erfomed

1.0 Create #nvoice

#nvoice

2olicy *umber
(pply #nsurance 2remium

2ayment (mount

/ours .or ed

".1

2ay -ate
Calculate &ross 2ay

Data Flow
Deposit

#s a path for data to move from one part of the #! to another (rrows depicting movement of data Can represent flow between process and data store by two separate arrows
".1 2ost 2ayment
2ayment Detail #nvoice Detail

D1

(ccounts -eceivable

Data Flow8 Correct6#ncorrect:


1.0 2ost 2ayment

Courses
Customer 2ayment

Class 7ist

D"

Daily 2ayments

!tudents

Daily 2ayment

;.0 2repare Deposit

Data !tore
D1 !tudents

#s used in a DFD to represent data that the system stores 7abels should be noun phrases

-ule8 Data !tore

$ust have at least one incoming and one outgoing data flow
Customer 2ayment

D1

Daily 2ayments

Daily 2ayment

Data !tore8 Correct6#ncorrect:


".0 <oo Flight

D"

(ccounts -eceivable

#nvoice Detail

2ayment Detail

Fight -e4uest
%.0

2assengers

2ost 2ayment

!ource6!in (,xternal ,ntity)


'rder
C)!+'$,-

1.0 9erify 'rder

#nvoice

,xternal entity that is origin or destination of data (outside the system) #s the singular form of a department= outside organisation= other #!= or person 7abels should be noun phrases

!ource > ,ntity that supplies data to the system !in > ,ntity that receives data from the system

-ule8 !ource6!in

$ust be connected to a process by a data flow

<(*?

<an Deposit

".0 2repare Deposit

!ource6!in 8 Correct6#ncorrect:
2(@-'77 D,2(-+$,*+
C)!+'$,C)!+'$,-

2aychec

2ayment

2ayment

,$27'@,,

%.0 (pply 2ayment

(ccounts -eceivable

-ules for )sing DFD !ymbols

Data Flow +hat Connects


@,! *'

( process to another process ( process to an external entity ( process to a data store (n external entity to another external entity (n external entity to a data store ( data store to another data store

7ist the errors of this DFD

DF " ,1 DF 1 1.0 2"

DF 1

D! 1

D DF ; DF 0 DF "

".0

21

Context Diagram

+op3level view of #! !hows the system boundaries= external entities that interact with the system= and maAor information flows between entities and the system. ,xample8 'rder system that a company uses to enter orders and apply payments against a customerBs balance

Context Diagram of 'rder !ystem

'rder
C)!+'$,.(-,/')!,

'rder -eAect *otice 2ayment #nvoice


0 'rder !ystem

2ic ing 7ist

Completed 'rder

Commission

<an Deposit

!(7,! -,2

(CC')*+#*&

<(*?

7evel30 DFD

!hows the systemBs maAor processes= data flows= and data stores at a high level of abstraction .hen the Context Diagram is expanded into DFD level30= all the connections that flow into and out of process 0 needs to be retained.

Context Diagram of 'rder !ystem

'rder
C)!+'$,.(-,/')!,

'rder -eAect *otice 2ayment #nvoice


0 'rder !ystem

2ic ing 7ist

Completed 'rder

Commission

<an Deposit

!(7,! -,2

(CC')*+#*&

<(*?

'rder

7evel30 DFD of 'rder !ystem

2ic ing 7ist . (-,/')!, 1.0 Fill 'rder

C)!+'$,-

'rder -eAect *otice #nvoice

".0 2ayment #nvoice D1 (ccounts -eceivable #nvoice Detail Create #nvoice Completed 'rder

2ayment Detail

%.0 (pply 2ayment

Commission

<an Deposit

Cash -ece

7ower37evel Diagrams

Functional Decomposition
(n

iterative process of brea ing a system description down into finer and finer detail )ses a series of increasingly detailed DFDs to describe an #!

<alancing
+he

conservation of inputs and outputs to a data flow process when that process is decomposed to a lower level ,nsures that the input and output data flows of the parent DFD are maintained on the child DFD

!trategies for Developing DFDs

+op3down strategy
Create

the high3level diagrams (Context Diagram)= then low3level diagrams (7evel30 diagram)= and so on the low3level diagrams= then higher3 level diagrams

<ottom3up strategy
Create

,xercise8
2recision +ools sells a line of high34uality woodwor ing tools. .hen customers place orders on the companyBs .eb site= the system chec s to see if the items are in stoc = issues a status message to the customer= and generates a shipping order to the warehouse= which fills the order. .hen the order is shipped= the customer is billed. +he system also produces various reports. Draw a context diagram for the order system Draw DFD diagram 0 for the order system

#dentify ,ntities=2rocess=Data !tores 5 Data Flow

,ntities

Customer .arehouse (ccounting 1.0 Chec !tatus ".0 #ssue !tatus $essages %.0 &enerate !hipping 'rder 0.0 $anage (ccounts -eceivable 1.0 2roduce -eports D1 2ending 'rders D" (ccounts -eceivable

Data Flows

2rocesses

Data !tores

'rder #n3!toc -e4uest 1.0 'rder Data !tatus Data ".0 !tatus $essage !hipping 'rder %.0 'rder Data #nvoice !hipping Confirmation 0.0 2ayment (ccounting Data (ccounts -eceivable Data 1.0 'rder Data #nventory -eports

'rder C)!+'$,2ayment #n3!toc -e4uest

.(-

!tatus $essage #nvoice

0 'rder !ystem #nventory -eports

!hipping 'rder

!hipping Conf

Context Diagram of 'rder !ystem

(CC')*+#*&

'rder C)!+'$,!tatus $essage !tatus Data ".0 !hipping Confirmation #ssue !tatus $essages D1

#n3!toc -e4uest

.(-,/')! 1.0 Chec !tatus 'rder Data 2ending 'rders %.0 &enerate !hipping 'rder

!hipp 'rder

'rder Data 2ayment #nvoice 0.0 'rder Data $anage (ccounts -eceivable 1.0 (ccounts -eceivable Data (ccounts -eceivable #nventory

7evel30 of 'rder !ystem

(ccounting Data

D"

2roduce -eports

Decision +rees

Decision Trees

Planning Tool

Decision +rees
,nable a business to 4uantify decision ma ing )seful when the outcomes are uncertain 2laces a numerical value on li ely or potential outcomes (llows comparison of different possible decisions to be made

Decision +rees

Limitations:
/ow

accurate is the data used in the construction of the tree: /ow reliable are the estimates of the probabilities: Data may be historical > does this data relate to real time: *ecessity of factoring in the 4ualitative factors > human resources= motivation= reaction= relations with suppliers and other sta eholders

Process

+he 2rocess
Economic growth rises 0.7 Expected outcome 300 000

Expand by opening new outlet Economic growth declines 0.3 Maintain current status 0 +he circle denotes the point where different outcomes could occur. +he estimates of the probability and the nowledge of the expected outcome allow the firm to ma e a calculation of the li ely return. #n this ( s4uare example it is8 denotes the point where a decision is made= #n this example= a business is contemplating +here is also the outlet. option +he to do nothing and current status wouldcontinues have an outcome opening a new uncertainty is maintain the state the of the economy > 4uoD if the+his economy to grow of C0. ,conomic growth rises8 is 0.E x C%00=000 F C"10=000 healthily the option estimated to yield profits of C%00=000. /owever= if the economy fails to grow as expected= the potential loss is estimated at C100=000. ,conomic growth declines8 0.% x C100=000 F 3C110=000 +he calculation would suggest it is wise to go ahead with the decision ( a net GbenefitB figure of HC;0=000) Expected outcome !"00 000

The Process
Economic growth rises 0." Expected outcome 300 000 Expand by opening new outlet Economic growth declines 0." Maintain current status 0 Expected outcome !"00 000

7oo what happens however if the probabilities change. #f the firm is unsure of the potential for growth= it might estimate it at 10810. #n this case the outcomes will be8 ,conomic growth rises8 0.1 x C%00=000 F C110=000 ,conomic growth declines8 0.1 x 3C100=000 F 3C"10=000 #n this instance= the net benefit is 3C100=000 > the decision loo s less favourableD

#d$antages

Disad$antages

Decision +ables

$odeling 7ogic with Decision +ables


( matrix representation of the logic of a decision !pecifies the possible conditions and the resulting actions <est used for complicated decision logic

$odeling 7ogic with Decision +ables

Consists of three parts


Condition

stubs

7ists condition relevant to decision

(ction

stubs

(ctions that result from a given set of conditions !pecify which actions are to be followed for a given set of conditions

-ules

$odeling 7ogic with Decision +ables

#ndifferent Condition

Condition whose value does not affect which action is ta en for two or more rules *ame the condition and values each condition can assume *ame all possible actions that can occur 7ist all rules Define the actions for each rule !implify the table

!tandard procedure for creating decision tables


Figure I30 Complete decision table for payroll system example

I.0% I.0%

Constructing a Decision +able

2(-+ 1. F-($, +/, 2-'<7,$.

#dentify the conditions (decision criteria). +hese are the factors that will influence the decision.

,.g.= .e want to now the total cost of a studentBs tuition. .hat factors are important: ,.g. .hat are they for each factor identified above: ,.g. .hat types of calculations would be necessary:

#dentify the range of values for each condition or criteria.

#dentify all possible actions that can occur.

2(-+ ". C-,(+, +/, +(<7,.

Create a table with 0 4uadrants.


2ut the conditions in the upper left 4uadrant. 'ne row per condition. 2ut the actions in the lower left 4uadrant. 'ne row per action. (lternate values for first condition. -epeat for all values of second condition. ?eep repeating this process for all conditions. 2ut the rules in the upper right 4uadrant. #n the lower right 4uadrant= determine what= if any= appropriate actions should be ta en for each rule.

7ist all possible rules.


,nter actions for each rule

-educe table as necessary.

,xample

Calculate the total cost of your tuition this 4uarter.


.hat

do you need to now:

7evel. ()ndergrad or graduate) !chool. (C+#= 7aw= etc.) !tatus. (Full or part time) *umber of hours
(ctions:

(ctions:

Consider C+# only (to ma e the problem smaller)8 )6&


2art +ime (1 to 11 hrs.)8 100.006per hour Full +ime (1" to 1J hrs.)8 10000.00 K Credit hours over 1J are charged at the part3time rate 2art time (1 to E hrs.)8 1"0.006per hour Full time (LF J hrs.)8 1"0.006per hour

&raduate8

Create a decision table for this problem

,ntity -elationship Diagrams


<asic ,lements and -ules

I.0J I.0J
0J

Conceptual Data $odeling= ,3- Diagrams

49

#mportance of Conceptual Data $odeling

Data rather than processes are more complex in many modern information systems. Characteristics of data (structure= properties) are more stable= i.e. less li ely to change over time= easier to reach consensus on. #t is shared between many processes= therefore is crucial in the design of databases= ensuring integrity of the data in an information system= efficiency of processing.

10

'utline
2urpose and importance of conceptual data modeling ,ntity3-elationship $odel

,ntity

(ttributes

-elationships

11

An Entity

!omething of interest in the environment (e.g.= person= place= obAect= event= concept) -epresented in ,3- diagram by a rectangle (n instance is a particular occurrence of an entity

CUSTOMER Entity, or Entity Type

0010 Scott George 56 Neat Street Boulder, Colorado 5!!"#"$%% 50$#"% #!$&%

1"

'n (n)tance o* t+e Cu)to,er Entity

Entities

Entity Type 3 a collection of entity instances that share common properties (also simply called
an Entity)

Entity Instance 3 an individual occurrence of an entity type

1%

Example Entity & Instances


(denti*ier 'ttri3ute
Cu)t-(. 0001 000" 000 000& 0005 0006 000$ 000% /a)t-Na,e Snerd 0ogg ',o) Targa George Guy S,it+ S,it+ 0ir)t-Na,e 'ddre)) City ST 1ip

Morti,er General .eli2ery Ta,pa 0/ 6&$ Bo3 56$ 0ogg /ane O,a+a NE "&05 0a,ou) " Coo4ie Ct5 Mia,i 0/ 1 Ma6ine 6$ 0a)t /ane Clinton N7 "00!" Scott 56 Neat St5 Boulder CO 5!!" Nice "%0 8lea)ant St5 Ta,pa 0/ 6&1 Bo3 $6 9ua4er 8at+ :ynn N; "111! 7a,e) " & Bay2ie< Ta,pa 0/ 6&1

10

<asic ,3- $odel Constructs and notation

Entity
Attribute

Relationship

11

Sa,ple E#R .iagra, =*igure #1>

1;

.hat !hould an ,ntity <e:

!/')7D <,8
(n

obAect that is important to business (n obAect that will have many instances in the database (n obAect that will be composed of multiple attributes

!/')7D *'+ <,8


(

user of the database system(unless system eeps trac of users) (n output of the database system (e.g. a report)
1E

<usiness -ules

2olicies and rules about the operation of a business that a data model represents
&overn how data is stored and handled. ,.g. Ma section of a course has between 11 and %1 studentsN

$ust be expressed in terms familiar to end users= clear and concise. *ot all business rules are related to data

1J

0igure #&

(nappropriate entitie)

Sy)te, u)er

Sy)te, output

'ppropriate entitie)

1I

An Attribute
( discrete data element ( characteristic (property) of an entity
CUSTOMER
Cu)to,er-Nu,3er /a)t-Na,e 0ir)t-Na,e Street-'ddre)) City State 1ip 8+one

This Customer entity has eight attributes

;0

Types of Attributes

!imple vs. Composite


!imple 3 most basic level Composite > decomposable into a group of related attributes ex8 address (street= city= state= Oip)

!ingle 9alued vs. $ulti 9alued >


!ingle 3 only one value per entity instance (e.g.= last name= date of
birth)

$ulitvalued3 multiple values per entity instance (e.g.= degrees= clubs=


s ills)

!tored vs Derived (e.g. Date'f<irth vs (ge)

;1

(ttributes on ,-Ds
$ay be shown on ,-Ds as ellipses

e,p#id 8?;S(C('N na,e addre)) 'd,it) 0

pt#nu, 8'T(ENTS

na,e

<ard

;"

(ttributes on ,-Ds
Multivalued attributes are shown as double ellipses Composite attributes may be shown bro en down into their simple components
Si,ple@Single AaluedB 8ri,ary Cey

Multi2alued

e,p#id

co,po)ite *-na,e

)4ill)
;%

EM8/O;EE

na,e

,-na,e l-na,e

+extboo Bs notation
'n attri3ute 3ro4en into co,ponent part)

$ultivalued an employee can have more than one s ill


;0 ;0

Derived from date employed and current date

Identifiers/Primary Key

Every instance of an entity must be uni4uely identified (to


unambiguously distinguish them)

(n identifier can be one or more attributes called a composite identifier (e.g.= first name= middle name= and last name) Partial identifier (in weak entities) > attribute that together with some attribute from another entity identifies an instance Underline identifiers in diagrams

;1

Identifiers

$ust be uni4ue !hould not change value over time &uaranteed to have a valid value *o intelligent identifiers (e.g. containing locations or people that might change) Consider substituting single3attribute identifiers for composite identifiers
to simplify design and enhance performance

CUSTOMER
Cu)to,er-Nu,3er /a)t-Na,e 0ir)t-Na,e 'ddre)) City State 1ip 8+one

;;

Relationships

( relationship is an association between one or more entities +he degree of a relationship indicates the number of entities involved +he cardinality of a relationship describes the number of instances of one entity associated with another entity

;E

Figure %310 -elationship types and instances

a) -elationship

b) -elationship instances

;J

ardinality

onstraints

( patient history is recorded for one and only one patient

( patient must have recorded at least one history= and can have many

Optional relation)+ip) 0 0 none or one none or ,ore

Mandatory relation)+ip) one and only one one or ,ore

;I

Cardinality Constraints
Cardinality Constraints 3 the number of instances of one entity that can or must be associated with each instance of another entity. $inimum Cardinality

#f

Oero= then optional #f one or more= then mandatory

$aximum Cardinality
+he

maximum number

E0

!e"rees of Relationships: unary and binary


T+e nu,3er o* di**erent entitie) in2ol2ed in a relation)+ip

EM8/O;EE

Manage)

UN'R;

B(N'R;
STU.ENT
E1

() a))igned

.ORM(TOR;

!e"rees of Relationships # ternary

( vendor supplies parts to warehouses. +he unit cost and delivery method may differ for every warehouse.

NoteD a relation)+ip can +a2e attri3ute) o* it) o<n


E"

$ore on -elationships

-elationships (many3to3many or one3to3one) can have attributes

+hese describe features pertaining to the association between the entities in the relationship

+wo entities can have more than one type of relationship between them (multiple relationships) (ssociative ,ntity F combination of relationship and entity !ome typical cases

E%

E6a,ple) o* ,ultiple relation)+ip) E entitie) can 3e related to one anot+er in ,ore t+an one <ay 0igure #"1a E,ployee) and depart,ent)

E0

+ime stamping

E1

,ntities can be related to one another in more than one way

0igure #"1a E,ployee) and depart,ent)


E;

!trong vs. .ea ,ntities= and #dentifying -elationships

!trong entities

exist independently of other types of entities has its own uni4ue identifier represented with single3line rectangle dependent on a strong entityPcannot exist on its own Does not have a uni4ue identifier represented with double3line rectangle lin s strong entities to wea entities represented with double line diamond

.ea entity

#dentifying relationship

EE

(ssociative ,ntities

(ssociative entities provide details of a many3to3many association. #tBs an entity > it has attributes (*D itBs a > it lin s entities together .hen should a relationship with attributes instead be an associative entity: &uidelines8

relationship

(ll relationships for the associative entity should be many +he associative entity could have meaning independent of the other entities +he associative may be participating in other relationships other than the entities of the associated relationship +he associative entity preferably has a uni4ue identifier= and should also have other attributes. #f an associative entity may have a partial identifier. +ernary relationships should be converted to associative entities

EJ

(n associative entity (C,-+#F#C(+,) (Fig. %3 11b)

'))ociati2e entity i) depicted a) a rectangle <it+ a dia,ond in)ide5

EI

$odeling a ternary relationship as an associative entity

J0

#ntroduction to ,ntity3 -elationship (,3-) $odeling

*otation uses three main constructs


Data

entities -elationships (ttributes

,ntity3-elationship (,3-) Diagram


(

detailed= logical representation of the entities= associations and data elements for an organiOation or business

10.J1 10.J1

,ntity3-elationship (,3-) $odeling


?ey +erms

,ntity
( person= place= obAect= event or concept in the user environment about which the organiOation wishes to maintain data -epresented by a rectangle in ,3- diagrams

,ntity +ype

( collection of entities that share common properties or characteristics ( named property or characteristic of an entity that is of interest to an organiOation

(ttribute

10.J" 10.J"

,ntity3-elationship (,3-) $odeling


?ey +erms

Candidate eys and identifiers


,ach

entity type must have an attribute or set of attributes that distinguishes one instance from other instances of the same type Candidate ey

(ttribute (or combination of attributes) that uni4uely identifies each instance of an entity type

,xamples

#dentify a few entity types= instances= attributes and candidate eys for8
De2aul

Campus Connect -egistration !ystem #llinois <ureau of $otor 9ehicles !ystem (maOon.com 2roduct #nformation !ystem

Depicting ,ntities and (ttributes

Draw a portion of the ,-D for each of these systems8


Campus Connect -egistration !ystem <ureau of $otor 9ehicles !ystem (maOon.com 2roduct #nformation !ystem

Conceptual Data $odeling and the ,3- Diagram


&oal

Capture as much of the meaning of the data as possible #f you now the rules of normaliOation= referential integrity= foreign eys= etc.= this is good but not as important now. #t is much more important to get the organiOational data model correct= i.e. to understand the actual data re4uirements for the organiOation. ( better design that is scalable and easier to maintain

-esult

,ntity3-elationship (,3-) $odeling


?ey +erms

#dentifier
( candidate ey that has been selected as the uni4ue identifying characteristic for an entity type !election rules for an identifier 1. Choose a candidate ey that will not change its value ". Choose a candidate ey that will never be null %. (void using intelligent eys 0. Consider substituting single value surrogate eys for large composite eys

,ntity3-elationship (,3-) $odeling


?ey +erms

-elationship
(n

association between the instances of one or more entity types that is of interest to the organiOation (ssociation indicates that an event has occurred or that there is a natural lin between entity types -elationships are always labeled with verb phrases

Cardinality

+he number of instances of entity < that can be associated with each instance of entity ( $inimum Cardinality
+he minimum number of instances of entity < that may be associated with each instance of entity ( +his is also called MmodalityN.

$aximum Cardinality

+he maximum number of instances of entity < that may be associated with each instance of entity (

I.I0 I.I0
I0

*aming and Defining -elationships


-elationship name is a verb phrase (void vague names &uidelines for defining relationships
Definition explains what action is being ta en and why it is important &ive examples to clarify the action 'ptional participation should be explained ,xplain reasons for any explicit maximum cardinality

*aming and Defining -elationships

&uidelines for defining relationships


,xplain

any restrictions on participation in the relationship ,xplain extent of the history that is ept in the relationship ,xplain whether an entity instance involved in a relationship instance can transfer participation to another relationship instance

10.I" 10.I"

,ntity

M(n entity is a business obAect that represents a group= or category of data.N1 Do we now a similar concept:

1) !tephens= -.?. and 2lew. -.-.= "001. Database Design. !($!= #ndianapolis = #*.

(ttribute

M(n attribute is a sub3group of information within an entity.N1 Do we now a similar concept:

1) !tephens= -.?. and 2lew. -.-.= "001. Database Design. !($!= #ndianapolis = #*.

,ntity -elationship $odels


$andatory -elationships 'ptional -elationships $any3to3$any -elationships 'ne3to3$any -elationships 'ne3to3'ne -elationships -ecursive -elationships

$andatory= $any3to3$any

#*!+-)C+'-

!+)D,*+

#*!+-)C+'-

!+)D,*+

'ptional= $any3to3$any

D,2(-+$,*+

!+)D,*+

D,2(-+$,*+

!+)D,*+

'ptional6$andatory= $any3to3$any

#*!+-)C+'-

!?#77

#*!+-)C+'-

!?#77

'ptional6$andatory= 'ne3to3$any

2-'D)C+

9,*D'-

2-'D)C+

9,*D'-

$andatory= 'ne3to3'ne

()+'$'<#7,

,*&#*,

()+'$'<#7,

,*&#*,

-ecursive

,$27'@,,

supervises

is supervised by

-esolving $any3to3$any -elationships

$any3to3many relationships should be avoided. .e can resolve a many3to3many relationship by dividing it into two one3to3 many relationships.

-esolving $any3to3$any -elationships

!(7,! '-D,-!

#*9. #+,$!

!(7,! '-D,-!

'-D,- #+,$!

#*9. #+,$!

,xample (,- Diagram)


C)!+'$,-! C7,-?!

!(7,! '-D,-!

'-D,- #+,$!

#*9. #+,$!

I. I. 101 101

101