Transcript Document
Data Flow Diagrams Creating Data Flow Diagrams Creating DFDs is a highly iterative process of gradual refinement. General steps: 1. Create a preliminary Context Diagram 2. Identify the ways in which users (use case) most commonly use the system 3. Create DFD fragments for each use case. 4. Create a Level 0 diagram from fragments 5. Decompose to Level 1,2,… 6. Go to step 1 and revise as necessary 7. Validate DFDs with users. Data Flow Diagramming Rules General Specific rules to Symbols Context Diagram Level 0 and lower decompositions Balancing across levels DFD Rules—General Basic rules that apply to all DFDs Inputs to a process are always different than outputs Objects always have a unique name 8.4 In order to keep the diagram uncluttered, you can repeat data stores and sources/sinks on a diagram DFD Rules—Symbols Process No process can have only outputs (a miracle) No process can have only inputs (black hole) A process has a verb phrase label 8.5 Data Store Data cannot be moved directly from one store to another Data cannot move directly from an outside source to a data store Data cannot move directly from a data store to a data sink Data store has a noun phrase label DFD Rules—Symbols Source/Sink Data cannot move directly from a source to a sink A source/sink has a noun phrase label 8.6 Data Flow A data flow has only one direction of flow between symbols A fork means that exactly the same data goes from a common location to two or more processes, data stores or sources/sinks DFD Rules—Symbols Data Flow (Continued) L. A join means that exactly the same data comes from any M. N. O. P. 8.7 two or more different processes, data stores or sources/sinks to a common location A data flow cannot go directly back to the same process it leaves A data flow to a data store means update A data flow from a data store means retrieve or use A data flow has a noun phrase label DFD Rules—Context Diagram One process, numbered 0. Sources and sinks (external entities) as squares Main data flows depicted No internal data stores are shown They are inside the system External data stores are shown as external entities Decomposition of DFDs Functional decomposition Act of going from one single system to many component processes This is a repetitive procedure allowing us to provide more and more detail as necessary The lowest level is called a primitive DFD Level-N Diagrams A DFD that is the result of n nested decompositions of a series of subprocesses from a process on a level-0 diagram 8.9 DFD Rules—Balancing DFDs When decomposing a DFD, you must conserve inputs to and outputs from a process at the next level of decomposition. This is called balancing. Balanced means: Number of inputs to lower level DFD equals number of inputs to associated process of higher-level DFD Number of outputs to lower level DFD equals number of outputs to associated process of higherlevel DFD 8.10 DFD Rules—Balancing DFDs Example: FavoriteBurger’s In Context Diagram, notice that there is one input to the system, the customer order Three outputs: 8.11 Customer receipt Food order Management reports DFD Rules—Balancing DFDs Example (Continued) Notice Level-0 DFD, We have the same inputs and outputs No new inputs or outputs have been introduced We can say that the context diagram and level-0 DFD are balanced 8.12 An unbalanced set of data flow diagrams—why? (a) Context diagram (b) Level-0 diagram 8.13 DFD Rules—Balancing DFDs In unbalanced example, In context diagram, we have one input to the system, A and one output, B Level-0 diagram has one additional data flow, C These DFDs are not balanced 8.14 Balancing DFDs We can split a data flow into separate data flows on a lower level diagram 8.15 Data Flow Splits and Joins A composite data flow at a higher level may be split if different parts go to different processes in the lower level DFD. This remains balanced because the same data is involved, but split into two parts. Balancing DFDs Balancing leads to additional advanced rules Composite data flow at one level can be split into component data flows at next level. Inputs to the process must be sufficient to produce the output 8.17 Using DFDs as Analysis Tools Gap Analysis The process of discovering discrepancies between two or more sets of data flow diagrams or discrepancies within a single DFD Inefficiencies in a system can often be identified through DFDs. Example Draw the DFD for a distance education university. The enrolment process works as follows: Students send in an application form containing their personal details, and their desired course The university checks that the course is available and that the student has necessary academic qualifications. If the course is available the student is enrolled in the course, and the university confirms the enrolment by sending a confirmation letter to the student. If the course is unavailable the student is sent a rejection letter. Example Read the problem description carefully looking for: people/organisations/things that supply information to or use information from the system => external entities (EE) actions/doing words/verbs => Processes (P) movement/exchange of information/data between external entities to processes, and processes to processes => data flows (DF) store/record information/data => data stores(DS) Example A student (EE) sends in an application form (DF) containing their personal details, and their desired course The university checks (P) that the course is available. If the course is available the student is enrolled (P) in the course, and the university confirms (P) the enrolment by sending a confirmation letter (DF) that they are registered for the course to the student. Or if the course is unavailable the student is sent a rejection letter (DF). Note: The university, or more specifically the administration section, is the system being modelled, it is not an EE. Example Context diagram Highest level DFD. Has data flows, external entities, one process (system in focus) and no data stores. Shows the system boundary and interactions with external entities. In this case: External entity - Student Process- Student Administration process application Data Flows - Application Form, Confirmation/Rejection Letter Example Student Application Details Student Administration System Confirmation/Rejection Details Example System/Level 0 DFD External entity - Student Processes - Check available, Enrol student, Confirm Registration Data Flows - Application Form, Course Details, Course Enrolment Details, Student Details, Confirmation/Rejection Letter Data Stores - Courses, Students. Example Confirmation/Rejection Details Student Application Details 1.0 Check Course Available Course Details Accepted/ Rejected Selections 2.0 Enrol Student Courses Course Details Course Enrolment Details Students Registration Details Student Details 3.0 Confirm Registered