Benefits from decomposing system into modules:
- Managerial - independent development
- Flexibility - easier to change product
- Comprehensibility - easier to understand product
- BAD: Each module corresponds to separate subroutine
- GOOD: Module hides ("chunk") information
- Important design decisions
- Design decisions which is likely to change
- Data structures
- Sequence of instructions to call a given routine and the routine itself
- The sequence of items processing
Hierarchical structure of dependencies and "clean" decomposition into modules are two desirable but independent properties of the system.
It is almost always incorrect to do decomposition of the system based on the flow chart (each block in the flow chart is a separate module). Instead begin with the list of difficult design decisions or decisions which is likely to change. Each module then designed to hide such decisions from others. So subroutines and programs (blocks in flow chart) is an assembled collection of code from various modules.