210 likes | 294 Views
EEE 243B Applied Computer Programming. Modeling II. What does the context diagram show us? What does the events list give us? In data flow diagrams: At a lower level of abstraction in the data flow diagram, can we create new data flows (arrows)?
E N D
EEE 243BApplied Computer Programming Modeling II
What does the context diagram show us? What does the events list give us? In data flow diagrams: At a lower level of abstraction in the data flow diagram, can we create new data flows (arrows)? Should we keep all the data flows from the higher abstraction in lower level abstractions? Review Maj JGA Beaulieu & Capt MWP LeSauvage
Outline • Models • Decomposition of Data Flow Diagrams (DFD) • Data Dictionary (DD) • Entity Relationship Diagram (ERD) Maj JGA Beaulieu & Capt MWP LeSauvage
Decomposition of DFD • As we have seen in the last lecture, decomposition applies to transformations (bubbles in the dataflow diagrams) in the same manner as we have seen for functions and modules “I only have a very small head and must live with it.” E. Dijkstra • But when do we stop drawing transformation bubbles? Maj JGA Beaulieu & Capt MWP LeSauvage
Decomposition of DFD • At the bottom level of the decomposition for a DFD, we find a transformation or process specification. • This specification is written in terms of pre and post conditions • A bubble is either separated by lower level diagrams or a transformation specification; not both Maj JGA Beaulieu & Capt MWP LeSauvage
Decomposition of DFD remove item information confirmation Remove Item 3.4.2 Inventory item catalogue descriptions Inventory items Product photos Maj JGA Beaulieu & Capt MWP LeSauvage
Decomposition of DFD Specification 3.4.2: Remove item precondition 1: REMOVE-ITEM-INFORMATION occurs precondition 2: the item must exist postcondition 1: no matching PRODUCT-PHOTO exists no matching CATALOGUE-DESCRIPTION exists no matching INVENTORY-ITEM exists postcondition 2: if the item was found CONFIRMATION is positive if it was not found CONFIRMATION is an error Maj JGA Beaulieu & Capt MWP LeSauvage
Data dictionary • The data flow arrows represent information that flows between transformations and data stores • Each data flow has a name, but there is no description of how the information is composed • Are we dealing with a complex data structure or bitwise information? • The Data Dictionary (DD) provides the information breakdown that is not available on the DFD Maj JGA Beaulieu & Capt MWP LeSauvage
Data dictionary • The concept: Data dictionary a = … Data flow diagram b = … c = … … f = … b a e f c d Maj JGA Beaulieu & Capt MWP LeSauvage
Data dictionary • Data dictionary defines the data items that are on the DFD • Describes the meaning of flows and stores • Specify the composition of complex data • Specify the range or values the data can take; this is later used in the software to perform error detection • Specify units that is represented by the data (mostly by comments in the DD) Maj JGA Beaulieu & Capt MWP LeSauvage
Data dictionary • Although data composition in DD can be expressed in any format you wish, it is common and highly recommended to use the following symbols to make your DD clear: = is composed of + and { } collection (or iteration) [..|..] select one of (enumerated type) ( ) optional field @ “part of” identifier for a store * * comments delimiter to emphasise use of data Maj JGA Beaulieu & Capt MWP LeSauvage
Data dictionary • Example: remove-item-information = item-id + item-catalogue-number inventory item = * an item is one element in the store Inventory items * @item-id + item-description + (UPC) Inventory-items = {item} * a collection of item * confirmation = [found | error] Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • So far our models to perform detailed designs of our structured programs are: • Context diagram – models the environment around our system; • Events list – gives us some high level sequencing of processes; • DFDs shows us where data goes in a system; • DDs provide information about the composition of this data; and • Specifications show how this information is used inside the transformation to go from pre to post conditions Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • But how does all this information relate to each other? • What is the relationship between a patient, a treatment and a drug? • What is the relationship between a generic test, a blood test, a toxicity test or a drug concentration test • The Entity Relationship Diagram provides us with a view of the static relationships that exist between our data Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • An ERD is composed of: Object types … Relationships patient drug is treated with patient drug Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • An ERD is composed of: Associative object type patient drug Medicated Treatment Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • An ERD is composed of: Supertype indicator Test Drug concentration test Blood test Toxicity test Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • Example: A doctor schedules a blood test for a patient Patient is Scheduled for Doctor Blood test Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • Example: A doctor treats a patient with a drug Drug is treated with Doctor Patient Maj JGA Beaulieu & Capt MWP LeSauvage
Entity Relationship Diagram • ERDs are read from each relationship: Drug Test Doctor is treated with is Scheduled for Blood test Patient Maj JGA Beaulieu & Capt MWP LeSauvage
Quiz Time • Can a DFD be decomposed into a specification and other sub-transformations • An ERD represents the __________ relationships of our data Maj JGA Beaulieu & Capt MWP LeSauvage