Lecture 19: Data Flow Diagrams (DFD) - Context & Level 1
Unit 3: Requirement Analysis and Design (4353202)
Lecture Agenda
- Recap of Coupling
- What is a Data Flow Diagram (DFD)?
- Components of a DFD
- DFD Levels: Context Diagram (Level 0)
- DFD Levels: Level 1 Diagram
- Example: Online Shopping System DFDs
- Advantages and Disadvantages of DFDs
- Key Takeaways
Recap of Coupling
Coupling measures the interdependence between modules. We aim for **low coupling** (ideally Data Coupling) to improve maintainability, reusability, and testability.
What is a Data Flow Diagram (DFD)?
A Data Flow Diagram (DFD) is a graphical representation of the flow of data through an information system. It shows how data enters and leaves the system, what changes the information, and where data is stored.
DFDs are used to visualize the major functions of a system and the data relationships between them.
Components of a DFD
- Process: A function that transforms data. Represented by a circle or a rounded rectangle.
- Data Flow: The movement of data between processes, external entities, and data stores. Represented by an arrow.
- External Entity (Terminator): A source or destination of data outside the system. Represented by a rectangle.
- Data Store: A place where data is held or stored. Represented by two parallel lines or an open-ended rectangle.
DFD Levels: Context Diagram (Level 0)
The Context Diagram, also known as Level 0 DFD, is the highest-level view of a system. It shows the entire system as a single process, along with its interactions with external entities.
- It defines the boundaries of the system.
- It shows the major inputs and outputs of the system.
- It does not show any internal details of the system.
Example: Online Shopping System - Context Diagram (Level 0)
DFD Levels: Level 1 Diagram
The Level 1 DFD provides a more detailed view of the system by breaking down the single process from the Context Diagram into its major sub-processes.
- It shows the main functions within the system.
- It illustrates the data flows between these internal processes, external entities, and data stores.
- It maintains consistency with the Context Diagram (inputs and outputs must match).
Example: Online Shopping System - Level 1 Diagram
Advantages of DFDs
- Clarity: Easy to understand and visualize the flow of data.
- Communication: Effective tool for communication between users and developers.
- Analysis: Helps in identifying missing data, redundant data, and incorrect processes.
- Hierarchical: Can be decomposed into multiple levels for detailed understanding.
Disadvantages of DFDs
- No Control Flow: Does not show the sequence of operations or decision logic.
- No Timing Information: Does not show when processes occur.
- Can Be Complex: For very large systems, DFDs can become cluttered and difficult to read.
- Requires Expertise: Creating effective DFDs requires skill and experience.
Key Takeaways
- **DFDs** graphically represent data flow in a system.
- Key components are **processes, data flows, external entities, and data stores**.
- **Context Diagram (Level 0)** shows the system as a single process.
- **Level 1 DFD** breaks down the system into its major sub-processes.
- DFDs are excellent for **visualizing data movement** but don't show control flow or timing.
Next Lecture
Topic: Object Modeling with UML - Introduction
Q & A
Questions & Discussion

