620 likes | 738 Views
ACG 6415. Data Modeling: Data Flow Diagrams Flow Charts. Logical DFD. A logical data flow diagram is a graphical representation of a system showing the system’s processes (as bubbles), data stores, and the flows of data into and out of the processes and data stores.
E N D
ACG 6415 Data Modeling: Data Flow Diagrams Flow Charts
Logical DFD • A logical data flow diagram is a graphical representation of a system showing the system’s processes (as bubbles), data stores, and the flows of data into and out of the processes and data stores. • WHAT tasks the system is doing— without having to specify how, where, or by whom the tasks are accomplished. • The advantage of a logical DFD (versus a physical DFD) is that we can concentrate on the functions that a system performs.
Data Flow Diagrams • Logical model of ? • Data gathered from requirements determination • RD determined what? • What the new system should do AND • What the old system does • Depiction of processes and data flows of a system
Data Flow Diagrams • Modeling tool • Graphically represent a system as • network of functional processes • connected to one another by “pipelines” and “holding tanks” of data. • The components of a typical dataflow diagram: the process, the flow, the store, and the terminator/Entity.
Employee Record Payroll Record Hours Worked Gross Pay Data Net Pay Data 1.0 4.2 2.1 4.1 2.2 3.1 2.3 3.2 Create Weekly Payroll Record Compute Gross Pay Print Employee Tax Form Compute Net Pay Calculate Payroll Deductions Sort Payroll Records by Employee Print Weekly Payroll Summary Create Payroll Check Time Sheet Sorted Records Employee Paycheck Employee Data File Payroll Data File S2 S1 Payroll Report Employee Payroll Record Payroll Deductions Employee Tax Form Level-1 DFD Employee Accounting Department
Benefits of DFD’s • Uncover misunderstandings of system processes • Help communicate analyst system understanding to management/end users • Helps to take the system out of context • Eases the problem of thinking outside of the box
The Process Process • the process name will describe what the process does. • Use Verb-Object Phrase • That is, the process sometimes describes who or what is carrying out the process, rather than describing what the process is. • In 6415 • we will only describe what the process does - logical vs. physical DFD
The Flow • A flow is represented graphically by an arrow into or out of a process • we wont use double sided arrows in class • used to describe the movement of chunks, or packets of information from one part of the system to another part. Thus, the flows represent data in motion • For many complex, real-world systems, the DFD will show the flow of materials and data. • The name represents the meaning of the packet that moves along the flow. A corollary of this is that the flow carries only one type of packet, as indicated by the flow name. • Note also that the flows show direction: • indicates whether data (or material) are moving into or out of a process
Diverging and Converging Flows • Diverging flow: • duplicate copies of a packet of data are being sent to different parts of the system • or that a complex packet of data is being split into several more elementary data packets, each of which is being sent to different parts of the system • Converging flow: • several elementary packets of data are joining together to form more complex, aggregate packets of data.
The Store • The store is used to model a collection of data packets at rest. • a store can be data stored on: • punched cards, microfilm, microfiche, or optical disk, or a variety of other electronic forms, a 3-by-5 index cards in a card box, or names and addresses in an address book, or several file folders in a file cabinet, or a variety of other non-computerized forms. • The notation for a store is two parallel lines • Typically, the name chosen to identify the store is the plural of the name of the packets that are carried by flows into and out of the store.
Entity The Terminator or External Entity • Terminators represent external entities with which the system communicates. • graphically represented as a rectangle • They are outside the system we are modeling; the flows connecting the terminators to various processes (or stores) in our system represent the interface between our system and the outside world. • These are Inputs and Outputs to/from the System • Entities providing Inputs are AKA Sources • Entities receiving Outputs are AKA Sinks • Entities can be both Sources and Sinks • Any relationship that exists between terminators will not be shown in the DFD model. • If there are relationships between the terminators, and if it is essential for these to be modeled then • the terminators are actually part of the system and should be modeled as processes.
DFD Guidelines • Choose meaningful names for processes, flows, stores, and terminators. • Number the processes. • Redraw the DFD as many times as necessary for esthetics. • Avoid overly complex DFDs. • Make sure the DFD is internally consistent and consistent with any associated DFDs (ie Balanced).
DFD Levels • DFD models are organized in a series of levels so that each level provides successively more detail about a portion of the level above • Top Level: Context Diagram • consists of only one bubble representing the entire system • the data flows show the interfaces between the system and the external entities • Successive Levels: • Figure/Level-0 • highest-level view of the major functions within the system • the major interfaces between those functions • Level-1 • ... • Level n
How Many Levels should you have? • each DFD figure should have no more than half a dozen bubbles and related stores. • Simple Systems • 2-3 Levels • Medium Sized System • 3-6 Levels • Large System • 5-8 Levels
Balancing DFD Levels • To ensure that each figure is consistent with its higher-level figure, we follow a simple rule: • the data flows coming into and going out of a bubble at one level must correspond to the data flows coming into and going out of an entire figure at the next lower level which describes that bubble.
How do you show stores at the various levels? • show a store at the highest level where it first serves as an interface between two or more bubbles • then show it again in EVERY lower-level diagram that further describes (or partitions) those interface
Context Diagram • One Process • Describes System / Process • At least one Entity • Outside of System / Process • At least one Source & one Sink
Employee Tax Form Payroll Report Time Sheet Employee Payroll Check 0 Employee Payroll System Context-Level Diagram Employee Accounting Department
2.0 Employee Record Paycheck Data Employee Compute Weekly Paycheck S1 S2 Payroll Record Hours Worked 3.0 1.0 Employee Payroll Record Prepare Weekly Payroll Summary Create Weekly Payroll Record Time Sheet Employee Paycheck Payroll Report 4.0 Prepare Employee Tax Form Employee Tax Form Accounting Department Payroll Data File Employee Data File Level-0 DFD
Employee Record Payroll Record Hours Worked Gross Pay Data Net Pay Data 1.0 4.2 2.1 4.1 2.2 3.1 2.3 3.2 Create Weekly Payroll Record Compute Gross Pay Print Employee Tax Form Compute Net Pay Calculate Payroll Deductions Sort Payroll Records by Employee Print Weekly Payroll Summary Create Payroll Check Time Sheet Sorted Records Employee Paycheck Employee Data File Payroll Data File S2 S1 Payroll Report Employee Payroll Record Payroll Deductions Employee Tax Form Level-1 DFD Employee Accounting Department
4.1.2 4.1.3 4.2.1 4.1.1 4.2.2 Print Employee Tax Form Calculate Retirement Allowance Calculate Employee Vacation Pay Calculate Payroll Tax Deductions Calculate Non-tax Deductions Employee Payroll Record Employee Tax Form Employee Data Employee Data Employee Data Employee Data Functional Primitive
Balanced DFDs • The next slide depicts “balanced” data flow diagrams. • Balanced DFDs exist when the external data flows are equivalent. • DFD (a) is a context diagram and (b) is an “explosion” of it into a level 0 logical DFD. • DFD (c), (d) and (e) are “explosions” of the logical level 0 DFD, and so on.
The Rules of DFDs In a nutshell… All data flows must begin and/or end at a process, because data flows either initiate or result from a process.
Rules Governing DFD Construction • A process cannot have only outputs – “miracle.” • A process cannot have only inputs – “black hole.” • The inputs to a process must be sufficient to produce the outputs from the process - (gray hole). • All data stores must be connected to at least one process.
Rules Governing DFD Construction • A data store cannot be connected to a source or sink. • A data flow can have only one direction of flow. Multiple data flows to and/or from the same process and data store must be shown by separate arrows. • If the exact same data flows to two separate processes, it should be represented by a forked arrow. • Data cannot flow directly back into the process it has just left. • All data flows must be named using a noun phrase.
Identifier Identifier Entity Name Process Name Process Name File Name 1.0 Employee Employee File Create Employee Paychecks Three Basic Illegal Data Flows Black Hole Miracle Gray Hole
D1 D2 Cust File D1 Customer 1.0 Employee Employee File Order File Create Employee Paychecks Other Illegal Flows Data Must Be Connected to a Process No Bi-Directional Flows
2.1.0 Process Name One Final Illegal Flow Data Cannot Flow Directly Back Into The Process It Left
2.2.0 2.3.0 2.1.0 2.2.0 2.3.0 2.1.0 Process Process Process Process Process Process A Debate Which is Right?
0 1.0 0 2.0 B B Source 2 Source Source Source 2 Source Sink Sink Sink A A Send Reports Context Level System Context Level System Format Data Formatted A A B C Formatted C C Balancing Data Flows
Preparing Data Flow Diagrams • Read narrative carefully - number lines and paragraphs in text • Prepare table of entities and activities • Draw context diagram - use DFD guidelines
Steps for Creating E&A Table • Read Narrative • Identify all Verb phrases (circle them) • Identify all Noun phrases (rectangles or data store) • Line by line insert noun as Entity and Verb as Activity along with data flow noun if present • Identify External Entities • Identify Internal Entities
DFD Guidelines • 1. Include on the systems documentation all (and only) activities and entities described in the systems narrative - no more, no less. • 2. When multiple entities operate identically, depict only one to represent all.
DFD Guidelines (cont.) • 3. For clarity, draw a data flow for each flow into and out of a data store. You may, also for clarity to help you determine that you have included all necessary flows, label each flow with the activity number that gives rise to the flow or with a description of the flow. • 4. If a data store is logically necessary (that is, because of a delay between processes), include a data store in the diagrams, whether or not it is mentioned in the narrative.
DFD Guidelines (Level-0 and higher) • 5. Group activities if they occur in the same place and at the same time. • 6. Group activities if they occur at the same time but in different places. • 7. Group activities that seem to be logically related. • 8. To make the DFD readable, use between five and seven bubbles. • 9. On a logical DFD, data flows cannot go from higher- to lower-numbered bubbles.
Common system flowcharting routines • The following slides show several common ways of showing processing using system flowcharting. • Pay particular attention to the way the columns are set up to communicate the flow of activities between processing entities.
The data-entry clerk keys in an input document into the computer. The computer accesses data in a data store 1 and in data store 2 to edit/validate the input. The computer displays the input, including any errors. The clerk compares the input document to the display, keys corrections as necessary, and accepts the input. The computer updates the table in data store 2 and notifies the clerk that the input has been recorded.
User queries the computer. The computer accesses the table(s) in one of more data stores & presents a response to the user. Update sequentialdata store from magnetic disk are input to the computer, along with the existing (old) master data – becoming the new master data
The user batches the input documents, prepares batch totals, and keys the documents into the computer. The computer records the inputs on disk and notifies the user as each input is accepted. The user files the input documents in numerical sequence. At the end of the batch, the computer prepares an exception & summary report that includes batch totals. The user compares the computer batch totals to those prepared earlier.
A data entry clerk enters documents into a networked PC system. The system records the inputs on a disk and notifies the user of the acceptance of each input. The documents are then forwarded to a different clerk who keys the documents again. Differences are resolved and the event data are updated to reflect the verifications and corrections.
A clerk scans a document into the computer. Use the data from the scanned document, the computer updates the data store(s)
A clerk scans a document into the computer. The computer routes an image of the scanned input to a data entry clerk, who keys data from the documents image into the computer. The computer records the data with the scanned document
Preparing Systems Flowcharts • 1. Divide the flowchart into columns; one column for each internal entity and one for each external entity. Label each column. • 2. Flowchart columns should be laid out so that the flowchart activities flow from left to right, but you should locate columns so as to minimize crossed lines and connectors.