CIS1107/1207 Overview: Data Flow Diagrams (DFDs) Used to: • Specify the flow of data • Specify the functions Features: • Divide and concur Dividing the system into a number of small separate tasks and then link them together. • Levels of abstraction Use different levels starting from a simple level to a more abstract level. • Information hiding The structure, the statements that access the structure, and the statements that modify the structure should be part of just a single module. This is an approach to structuring software in a highly modular fashion. • DFDs are constructed using different levels o Starting from Level 0 (Context Level) the includes only the terminals and one process representing the system. o Then Level 1 , Level 2, ... Level n. (Levels 2 to n cannot have terminals). • A DFD should end with PSPECs and CSPECs. • PSPEC (Process Specification) A description of what is happening inside each bottom-level, primitive bubble in a DFD. PSPECs are either described using pseudo code, or graphically using flowcharts, decision tables, etc... • CPSEC (Control Specification) Used to indicate how the system behaves when an event or control signal is sensed. DFD Notations Two main notations: • Gane/Sarson • Yourdon/DeMarco Symbols Gane/Sarson www.matthewxuereb/uni 1 CIS1107/1207 Symbols Yourdon/DeMarco Control and Event Flows • In conventional data flow diagrams, control or event flows are not represented explicitly. • A specialised notation for representing event flows and control processing has been developed. • This notation can be inputted directly to a (conventional) process or into a control process. www.matthewxuereb/uni 2 CIS1107/1207 Demonstration: A Basic DFD for a University Course Registration System Level 0 (Context Diagram) ******************** Level 1 ******************** www.matthewxuereb/uni 3 CIS1107/1207 Level 2 Level 2 for Validate Inputted Details Level 2 for Process Application www.matthewxuereb/uni 4 CIS1107/1207 Super imposed www.matthewxuereb/uni 5 CIS1107/1207 Example: Maltese number plate registration system (Taken from CSA1011 past paper [February 2005]) Draw up a DFD of a very simple Maltese car number plate registration system storing registered number plates on a database. Your system should offer the following functionality: • • • • • Register (add) a number Retire (delete) a previously registered number Check number for validity Check numbers for uniqueness against a database of assigned numbers Confirm valid registration You should decompose your DFDs to whatever level you deem necessary to produce PSPECs in any form of pseudo code you wish. All PSPECs must be shown. Level 0 (Context Diagram) ******************** Level 1 www.matthewxuereb/uni 6 CIS1107/1207 Level 2 Register Car Delete Car C www.matthewxuereb/uni a rR o ec rd 7 CIS1107/1207 Some DFDs Exercises Exercise 1 (Taken from CSA 1022 past paper 2009) Construct a basic DFD to model the possible behaviour of an on-line shopping website. The website should allow visitors to register, edit their profile, browse, share a common forum for registered visitors, and of course purchase products. You should propose a DFD model decomposed not further than level one. Exercise 2 (Taken from CSA 1022 past paper 2010) Propose DFD (i.e. excluding control) to describe the behaviour of a hypothetical and trivial on-line social interaction environment. The solution should support the following eleven features: 1. Guest login; 2. User registration; 3. User login; 4. Profile creation and editing; 5. Upload of images and PDF data up to a limit of 2 Gb; 6. Removal of images and PDF data; 7. Browsing of other registered users’ data; 8. Designation and separation of “friends-only” and “public” data; 9. Designation of registered users as friends, and vice-versa; 10. System administration features (treat this as one general feature); 11.User de-registration. The DFD should be described up to level one. In level one, select the sub-system describing features number 2 and number 5 in the list above and decompose them to level two including any WardMellor extensions (i.e. using both DFD & CFD notation) deemed necessary. No FSMs or DSDs are required. www.matthewxuereb/uni 8 CIS1107/1207 Exercise 3 (Taken from CSA 1022 past paper 2011) A very basic patient online appointment management solution allows a patient to do a number of things, namely to (not necessarily in this order): 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Register/Unregister from/on the system; Log in/out; Enter/edit their personal details; Enter/edit the details f their ailment and other comments; View doctor availability; Book/edit/cancel appointments; View one’s personal history; Send e-Mail messages to clinic reception staff; Print appointment slip(s); Manage payments and billing. Propose a DFD (excluding control) to describe the functional behaviour of this system. The solution should be described up t and including level one. In level one, select the sub-system describing feature number 3 and decompose it to level two. In this case, use any Ward-Mellor extended notation deemed necessary. No FSMs or DSDs are required. Make sure all notation used in your diagrams is clearly labelled. www.matthewxuereb/uni 9