- Year not given · 4+6 marks
Modular decomposition with a level-2 DFD
Short answer
Modular decomposition refines each sub-system into smaller modules by drawing a context diagram, then level-1 and level-2 DFDs, stopping when each process does one clear job; each such process becomes a module, and DFD inputs and outputs must balance. For a library system, process 2.0 Issue book is decomposed into validate member, check availability, record issue, and update book status modules.
How modular decomposition is practiced in system design? Illustrate with example of level-2 DFD.
Modular decomposition is the architectural design activity in which each sub-system, identified during system structuring, is broken down further into modules. A module is a component that provides services to other modules but is normally not a separate system on its own. The aim is modules that are highly cohesive and loosely coupled.
How modular decomposition is practiced
Sommerville describes two main decomposition models:
- Object-oriented decomposition – the sub-system is divided into a set of loosely coupled objects with well-defined interfaces. Designers identify object classes, their attributes and operations. Example: an invoice system decomposed into
Customer,Invoice,PaymentandReceiptobjects. - Function-oriented pipelining (data-flow model) – the sub-system is divided into functional modules that take inputs and transform them into outputs, like a pipe-and-filter chain. The DFD of the sub-system is refined, and each low-level process becomes a module.
Practical steps followed in function-oriented design:
- Draw the context diagram (level 0) of the system.
- Refine it into a level-1 DFD of major functions (sub-systems).
- Refine each level-1 process into a level-2 DFD of smaller functions.
- Stop when each process does one clear job; each such process becomes a module.
- Convert the DFD into a structure chart showing calling hierarchy and the data passed between modules.
- Check cohesion and coupling and adjust module boundaries.
Example: library management system
- Level 0 (context): one process, Library system, with external entities Member and Librarian.
- Level 1: three processes: 1.0 Manage members, 2.0 Issue book, 3.0 Return book, with data stores D1 Members, D2 Books and D3 Issue records. Each level-1 process is a sub-system.
- Level 2: each level-1 process is decomposed again. Process 2.0 Issue book is shown below; its inputs and outputs (member and book ids in, issue slip out) must match the flows of 2.0 at level 1. This rule is called balancing.
Level-2 DFD for process 2.0 Issue book
+--------+ member id,
| Member | book id
+--------+-----------+
v
+----------------+ ==============
| 2.1 Validate |<----- D1 Members
| member | ==============
+----------------+
| valid request
v
+----------------+ ==============
| 2.2 Check book |<----- D2 Books
| availability | ==============
+----------------+
| available book
v
+----------------+ ==============
| 2.3 Record |-----> D3 Issue records
| issue | ==============
+----------------+
| issue details
v
+----------------+ ==============
| 2.4 Update |-----> D2 Books
| book status | ==============
+----------------+
| issue slip (due date)
v
+--------+
| Member |
+--------+
Resulting modules (structure chart)
+--------------+
| Issue_Book |
+--------------+
+--------+-----+-------+--------+
| | | |
+----------+ +---------+ +--------+ +---------+
| Validate | | Check | | Record | | Update |
| Member | | Avail. | | Issue | | Status |
+----------+ +---------+ +--------+ +---------+
- Each level-2 process (2.1–2.4) becomes one module with a single function, so cohesion is functional.
- Modules pass only simple data (member id, book id, issue record), so coupling is data coupling.
- Each module can be coded and unit-tested separately, and a change (e.g. a new borrowing limit rule in 2.1) stays inside one module.
Benefits of modular decomposition
- Complexity is controlled: each level adds detail only to one part.
- Modules can be assigned to different programmers and developed in parallel.
- Testing is easier: each module is unit tested, then integrated.
- Maintenance is easier: changes are localised to one module.
- General modules (such as Validate member, used by both 2.0 and 3.0) can be reused.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- Book store process model · Software Engineering, chapter 2
- Role of reference architectures · Software Engineering, chapter 3
- Semi-modular pipe outlet design, flexibility 0.9 · Irrigation and Drainage Engineering, chapter 7
- Algorithmic vs object-oriented decomposition · Object Oriented Analysis and Design, chapter 1
- Digital system, logic level, BCD vs binary · Digital Logic, chapter 1
- Triple modular redundancy; reliable C/S · Distributed System, chapter 9