Escolar Documentos
Profissional Documentos
Cultura Documentos
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
'rder Data 2ayment #nvoice 0.0 'rder Data $anage (ccounts -eceivable (ccounts -eceivable Data (ccounts -eceivable #nventory -eports
(ccounting Data
D"
2rocess
1.0
&rade Detail
&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
%.0
&ross 2ay
Calculated &ross 2ay
'rder
(ccepted 'rder
#nventory Change
2rocess8 Correct6#ncorrect:
!ervices 2erfomed
#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
Courses
Customer 2ayment
Class 7ist
D"
Daily 2ayments
!tudents
Daily 2ayment
Data !tore
D1 !tudents
#s used in a DFD to represent data that the system stores 7abels should be noun phrases
$ust have at least one incoming and one outgoing data flow
Customer 2ayment
D1
Daily 2ayments
Daily 2ayment
D"
(ccounts -eceivable
#nvoice Detail
2ayment Detail
Fight -e4uest
%.0
2assengers
2ost 2ayment
#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
<(*?
<an Deposit
!ource6!in 8 Correct6#ncorrect:
2(@-'77 D,2(-+$,*+
C)!+'$,C)!+'$,-
2aychec
2ayment
2ayment
,$27'@,,
(ccounts -eceivable
( 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
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
'rder
C)!+'$,.(-,/')!,
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.
'rder
C)!+'$,.(-,/')!,
Completed 'rder
Commission
<an Deposit
!(7,! -,2
(CC')*+#*&
<(*?
'rder
C)!+'$,-
".0 2ayment #nvoice D1 (ccounts -eceivable #nvoice Detail Create #nvoice Completed 'rder
2ayment Detail
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
+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
,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
.(-
!hipping 'rder
!hipping Conf
(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
(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
stubs
(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
#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
I.0% I.0%
#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:
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.
,xample
7evel. ()ndergrad or graduate) !chool. (C+#= 7aw= etc.) !tatus. (Full or part time) *umber of hours
(ctions:
(ctions:
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
I.0J I.0J
0J
49
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
0010 Scott George 56 Neat Street Boulder, Colorado 5!!"#"$%% 50$#"% #!$&%
1"
Entities
Entity Type 3 a collection of entity instances that share common properties (also simply called
an Entity)
1%
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
Entity
Attribute
Relationship
11
1;
!/')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
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
;0
Types of Attributes
!imple 3 most basic level Composite > decomposable into a group of related attributes ex8 address (street= city= state= Oip)
!ingle 3 only one value per entity instance (e.g.= last name= date of
birth)
;1
(ttributes on ,-Ds
$ay be shown on ,-Ds as ellipses
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)
Identifiers/Primary Key
(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
a) -elationship
b) -elationship instances
;J
ardinality
onstraints
( patient must have recorded at least one history= and can have many
;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
$aximum Cardinality
+he
maximum number
E0
EM8/O;EE
Manage)
UN'R;
B(N'R;
STU.ENT
E1
() a))igned
.ORM(TOR;
( vendor supplies parts to warehouses. +he unit cost and delivery method may differ for every warehouse.
$ore on -elationships
+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
!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
EI
J0
detailed= logical representation of the entities= associations and data elements for an organiOation or business
10.J1 10.J1
,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"
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
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
#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
-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
-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
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
1) !tephens= -.?. and 2lew. -.-.= "001. Database Design. !($!= #ndianapolis = #*.
$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
$any3to3many relationships should be avoided. .e can resolve a many3to3many relationship by dividing it into two one3to3 many relationships.
!(7,! '-D,-!
#*9. #+,$!
!(7,! '-D,-!
'-D,- #+,$!
#*9. #+,$!
!(7,! '-D,-!
'-D,- #+,$!
#*9. #+,$!
I. I. 101 101
101