Data Flow Diagrams A graphical tool, useful for communicating withusers, managers, and other personnel. Used to perform structured analysis to determinelogical requirements. Useful for analyzing existing as well as proposedsystems. Focus on the movement of data between externalentities and processes, and between processes anddata stores. A relatively simple technique to learn and use.
Why DFD ? Provides an overview of- What data a system processes What transformations are performed What data are stored What results are produced and where they flow Graphical nature makes it a good communication toolbetween- User and analyst Analyst and System designer
External Entities A Rectangle representsan external entity They either supply orreceive data They do not process dataExternalEntities• Source – Entity thatsupplies data to thesystem.• Sink – Entity thatreceives data from thesystem.
Data Flows Data in motion Marks movement of datathrough the system - a pipelineto carry data. Connects the processes, externalentities and data stores. Generally unidirectional, If samedata flows in both directions,double-headed arrow can beused.Data Flow
Processes A circle represents a process Straight line with incoming arrows are input dataflows Straight lines with outgoing arrows are output dataflows Labels are assigned to Data flow. These aiddocumentation1.STORESStores demandnoteDelivery SlipIssue Slip
Data Stores A Data Store is a repository of data Data can be written into the data store. This isdepicted by an incoming arrow Data can be read from a data store. This is depictedby an outgoing arrow External entity cannot read or write to the data store Two data stores cannot be connected by a data flowData StoresD1 Data StoresD1 Data StoresD1Writing Reading
Rules of Data Flow Data can flow from External entity to process Process to external entity Process to store and back Process to process Data cannot flow from External entity toexternal entity External entity to store Store to external entity Store to store
Data Flow DiagramsAn alternate notation is often used: A Process A Data Store3StoreIssueData StoresD1LabelNameNameLabel
Good Style in Drawing DFD Use meaningful names for data flows, processes anddata stores. Use top down development starting from contextdiagram and successively levelling DFD Only previously stored data can be read A process can only transfer input to output. It cannotcreate new data Data stores cannot create new data
Decomposition of DFDs A system is too complex to be shown on a single DFD. Decomposition is the iterative process of explodingdata flow diagrams to create more detail. Level 0 data flow diagrams may be exploded intosuccessive low levels of detail. The next level of detailwould be a level 1 data flow diagram. The DFDs become linked together ina hierarchy, which would fullydocument the system.
Why Level DFD If a DFD is too detailed it will have too manydata flows and will be large and difficult tounderstand Start from a broad overview. Expand to details –Idea similar to using procedures and linkingthese with a main program Each DFD must deal with one aspect of a bigsystem
Levels of DFD Context diagram Level-0 diagram (System diagram) Level-n diagram- Detail of one process from nexthighest level Primitive diagram (Lowest level DFD)
Levelling Rules If a process p is expanded, the process at the next levelare labelled as p.1, p.2 etc. All data flow entering or leaving p must also enter orleave it’s expanded version Expanded DFD may have data stores No external entity can appear in expanded DFD Keep the number of processes at each level less than 7
Balancing DFDs Information presented at onelevel of a DFD is accuratelyrepresented in the next levelDFD. Ensures that the input andoutput data flows of theparent DFD are maintainedon the child DFD.
Creating DFDs Create a preliminary Context Diagram. Identify Use Cases, i.e. the ways in which users mostcommonly use the system. Create DFD fragments for each use case. Create a Level 0 diagram from fragments. Decompose to Level 1,2,… Validate DFDs with users.
Creating the Context Diagram Draw one process representingthe entire system (process 0) Find all inputs and outputs thatcome from or go to externalentities; draw as data flows. Draw in external entities as thesource or destination of thedata flows.
Creating Level 0 Diagram Combine the set ofDFD fragments intoone diagram. Generally move fromtop to bottom, left toright. Minimize crossed lines.
Creating Level 1 Diagram Each use case is turned into its own DFD. Take the steps listed on the use case and depicteach as a process on the level 1 DFD. Inputs and outputs listed on use case become dataflows on DFD. Include sources and destinations of data flows toprocesses and stores within the DFD. May also include external entities for clarity.
When to stop decomposingDFDs?Ideally, a DFD has at leastthree levels.When the system becomesprimitive i.e. lowest levelis reached and furtherdecomposition is useless.
Validating DFD Check for syntax errors toassure correct DFD structure. Check for semantics errors toassure accuracy of DFDrelative to actual/desiredsystem.
UniversityAdmissionSystem0StudentStudent InformationReportStaffAdmission Approvalor RejectionReport RequestContext DiagramDFD for University Admission System
Level 1, Process 11.3ProduceSalesForecastSales ForecastPayment1.1RecordOrderCustomer OrderORDER1.2ReceivePaymentPAYMENTSevered OrderRequest for ForecastCUSTOMER
Level 1, Process 2 and Process 32.1ServeProductProduct OrderORDER2.2ProduceProductINVENTORTYQuantity SeveredProductionScheduleRAWMATERIALS2.3StoreProductQuantity Produced &Location StoredQuantity UsedProduction Data3.1ProducePurchaseOrderOrder DecisionPURCHASEORDER3.2ReceiveItemsReceivedGoodsRAWMATERIALS3.3PayVendorQuantityReceivedQuantity On-HandRECEIVEDITEMSVENDORPayment ApprovalPayment
Level 1, Process 4Time Worked4.1RecordTimeWorkedTIME CARDS4.2CalculatePayrollPayroll RequestEMPLOYEE4.3PayEmployeeEmployee IDPAYROLLPAYMENTSPayment ApprovalPaymentUnpaid time cards
Logical and Physical DFD DFDs considered so far are called logical DFDs A physical DFD is similar to a document flow diagram It specifies who does the operations specified by thelogical DFD Physical DFD may depict physical movements of thegoods Physical DFDs can be drawn during fact gatheringphase of a life cycle
Physical DFD for Cheque EncashmentCashClerkVerify A/CSignature UpdateBalanceBad ChequeStore chequesCustomer AccountsChequeCheque withToken numberCashierVerify TokenTake SignatureEntry in Day BookCUSTOMERTokenToken
In a DFD external entities are represented by aa. Rectangleb. Ellipsec. Diamond shaped boxd. Circle External Entities may be aa. Source of input data onlyb. Source of input data or destination of resultsc. Destination of results onlyd. Repository of data A data store in a DFD representsa. A sequential fileb. A disk storec. A repository of datad. A random access memory
By an external entity we mean aa. Unit outside the system being designed which can be controlled by an analystb. Unit outside the system whose behaviour is independent of the system beingdesignedc. A unit external to the system being designedd. A unit which is not part of DFD A data flow cana. Only enter a data storeb. Only leave a data storec. Enter or leave a data stored. Either enter or leave a data store but not both A circle in a DFD representsa. A data storeb. A an external entityc. A processd. An input unit