Cohesion and Coupling
Cohesion: a design unit has high cohesion if all its elements are strongly related
- coincidental: multiple, completely unrelated actions
- logical: series of related actions selected by parameter
- temporal: series of actions related in time
- procedural: series of actions sharing sequence of steps
- communicational: procedural cohesion but on the same data
- informational: series of independent actions on the same data
- functional: exactly one action
Coupling: a decomposition has low coupling if the design units are not strongly dependent on each other
- content: one directly references content of another
- common: both have access to same global data
- control: one passes an element of control to another
- stamp: one passes a data structure to another, which only uses part
- data: one passes only homogeneous data items