How to Create a Data Flow Diagram (DFD): Step-by-Step Guide
We will start with a Level 0 DFD (Context Diagram) and proceed to deeper process breakdowns in Level 1 and Level 2 diagrams. By the end, you'll understand how to create a structured diagram and navigate between different levels of decomposition.
Adding a New DFD Diagram
- Switch to the Project tab in the ribbon.
- Click on the Add New Diagram button to open the "New Diagram" dialog.
- From the left panel, choose Other and then select Data Flow Diagram - Gane and Sarson item.
- This notation displays processes as rounded rectangles.
- Enter Online Book Store as the name of the diagram.
- Click the OK button.
Creating the Context Diagram (Level 0)
The Level 0 DFD provides a high-level view of the entire system, including its key external entities and major data flows.
Add the Main Process:
- Drag the Process button from the toolbox to the canvas.
- Name this process Online Book Store.
Add External Entities:
- Drag the External Entity button from the toolbox.
- Name the external entities: Customer, Warehouse, and Payment Gateway.
Define the Data Flows:
- Connect Customer to Online Book Store and name the flow Order Information.
- Connect Online Book Store to Warehouse and name the flow Order Request.
- From Warehouse to Online Book Store, name the flow Stock Information.
- Connect Online Book Store to Payment Gateway with Payment Request.
- Finally, from Payment Gateway to Online Book Store, name the flow Payment Confirmation.
The context diagram is now complete. It provides an overview of the main data exchanges between the system and its external entities.
Adding Level 1 Diagram (Decomposing the Main Process)
In the Level 1 DFD, we break down the main Online Book Store process into smaller, more detailed processes.
Create the Level 1 DFD:
- Select the Online Book Store process and click the Add DFD Level 1 button in the context bar.
- A new sub-diagram will be created.
- Expand the Online Book Store node in the Project sidebar and drag the Customer entity into the new diagram.
- Drag also the Warehouse and Payment Gateway entities into the diagram.
Add and Connect Processes:
- Select the Customer entity and click the Data Flow to Process button.
- A process connected to the entity will be created.
- Name this process Process Customer Order.
- Add more processes in the same way:
- Check Inventory
- Process Payment
- Generate Invoice
Defining Data Flows
Define Flows:
- Connect Check Inventory to Warehouse with a data flow in both directions.
- Connect Payment Gateway to Process Payment with bi-directional flows.
- Connect Check Inventory to Order Details and Generate Invoice to Customer.
Let’s now add more detail to the data flow connectors. Each data flow will represent specific data exchanges.
- Double-click on the data flow between Customer and Process Customer Order.
- Set the data to Order Information.
- For the flow between Process Customer Order and Check Inventory, enter:
- Order Details for the forward flow.
- Stock Information for the backward flow.
- The same data flows should connect Check Inventory to Warehouse.
- Define the data between Process Customer Order and Process Payment as Order and Payment Details.
- For the Payment Gateway data flow, set:
- Order and Payment Details sent to the gateway.
- Payment Confirmation as the response from the gateway.
- For the data flow between Process Payment and Generate Invoice set the data to Order and Payment Details.
- Lastly, connect Generate Invoice to Customer with the data flow Invoice.
With this, the Level 1 DFD is complete.
Adding Level 2 Diagram (Further Decomposition)
For more detailed modeling, we can create a Level 2 DFD to break down individual processes even further.
Create a Level 2 DFD:
- Select the Process Payment element in the Level 1 DFD.
- Click the Add DFD Level 2 button in the context bar.
- In this sub-diagram, add three subprocesses:
- Validate Payment Method
- Send Payment Request
- Handle Payment Response
- Drag related higher-level processes into this diagram from the Project sidebar, Process Payment and Generate Invoice.
Define Data Flows:
- Connect Process Payment to Validate Payment Method with the flow named Payment Information.
- Connect Validate Payment Method to Send Payment Request with the flow Validated Payment Information.
- Connect Send Payment Request to Payment Gateway with the flow Payment Request.
- Connect Payment Gateway to Handle Payment Response with the flow Payment Confirmation.
- Connect Handle Payment Response to Generate Invoice with the flow Payment Confirmation.
Navigating Between Diagrams
Software Ideas Modeler makes it easy to navigate through nested DFD diagrams:
- In the context diagram, processes with nested diagrams will have an icon—a diagram frame with a bent arrow in the top-left corner.
- Click this icon to open a popup window displaying thumbnails of associated diagrams.
- Double-click on any thumbnail to navigate directly to that sub-diagram.
Download Example
You can download the project file with the example data flow diagrams here:
Online Book Store (DFD Project)
New Comment