- 2070 Chaitra (old course) · 10 marks
Purposes of DFD and ER diagram
Short answer
DFD models system processing: shows functions, data flows, system boundary, supports top-down analysis, communicates with users, finds errors early, and provides design basis. ER diagram models data: logical structure, entities/attributes/keys, relationships/cardinality, basis for database design, communicates data requirements, and ensures consistency with DFD. Example: online order system with DFD processes (validate order, process payment, dispatch) and ER entities (Customer, Order, Product).
What are the main purposes of DFD and ER diagram? Explain with example.
A Data Flow Diagram (DFD) models the processing side of a system: how data enters, is transformed by processes, is stored, and leaves. An Entity-Relationship (ER) diagram models the data side: which things (entities) the system keeps data about, their attributes, and how they are related. Together they give the functional view and the data view of the same system.
Purposes of DFD
- Show the functions of the system – every process (bubble) shows one transformation of input data into output data.
- Show the flow of data between external entities, processes and data stores, so the analyst sees where each data item comes from and where it goes.
- Define the system boundary – the context diagram (level 0) shows what is inside the system and which external entities it talks to.
- Support top-down analysis – the system is refined level by level (level 0 → level 1 → level 2), which controls complexity.
- Communicate with users – DFDs use only four symbols, so non-technical users can check them.
- Find errors early – missing inputs, unused outputs and duplicated processing become visible.
- Basis for design – processes in the DFD map to modules in the structure chart.
DFD symbols (Yourdon/DeMarco):
| Symbol | Meaning |
|---|---|
| Circle / rounded box | Process |
| Arrow | Data flow |
| Open rectangle (two lines) | Data store |
| Square | External entity (source/sink) |
Purposes of ER diagram
- Model the logical structure of data independent of how it is processed or stored.
- Identify entities, attributes and keys (e.g. Customer with
cust_idas primary key). - Show relationships and cardinality (1:1, 1:N, M:N) and participation constraints.
- Basis for database design – entities become tables, relationships become foreign keys or link tables.
- Communicate data requirements to users and database designers using one common picture.
- Check consistency – each data store in the DFD should be backed by entities in the ER diagram.
ER symbols: rectangle = entity, ellipse = attribute, diamond = relationship, lines with 1/N/M = cardinality.
Example: online order processing system
Assume a shop where a customer places an order, payment is processed and goods are dispatched.
Level-1 DFD
+----------+ order details +---------------+
| Customer |---------------->| 1.0 Validate |
+----------+ | order |
^ +---------------+
| ^ | valid order
| customer details | v
| ================== | +---------------+
| D1 Customers -------+ | 2.0 Process |
| ================== | payment |
| +---------------+
| | paid order
| invoice + goods v
| +---------------+
+----------------------------| 3.0 Dispatch |
| goods |
+---------------+
| order record
v
==================
D2 Orders
==================
ER diagram for the data used above:
+------------+ 1 /\ N +-----------+
| CUSTOMER |------<places>------| ORDER |
+------------+ \/ +-----------+
cust_id (PK) order_id (PK)
name, address date, amount
| M
/\
<contains>
\/
| N
+-----------+
| PRODUCT |
+-----------+
prod_id (PK)
name, price
- One customer places many orders (1:N).
- One order contains many products and a product appears in many orders (M:N), so the database needs an
Order_Item(order_id, prod_id, qty)table.
How the two diagrams work together
| Point | DFD | ER diagram |
|---|---|---|
| View | Functional / process | Data / structural |
| Main question | What happens to data? | What data is kept? |
| Main elements | Processes, flows, stores, entities | Entities, attributes, relationships |
| Time / order | Shows flow, not timing | No flow at all |
| Leads to | Program modules | Database tables |
| Example link | Data store D2 Orders | Entity ORDER |
The DFD tells us what the system does; the ER diagram tells us what the system must remember. A complete structured analysis uses both.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- ER diagram: cricket tournament · Database Management System, chapter 2
- ER diagram: employee, skill, machine · Database Management System, chapter 2
- ER diagram: product and components · Database Management System, chapter 2
- ER diagram: hospital management · Database Management System, chapter 2