Cohesion¶
Elements within a module should have a single, well-defined reason for being together; unrelated elements should be separated
Tension Addressed¶
Simplicity vs. Capability
Recognizable As¶
Functions that change for the same reason; data that travels together; classes with a single responsibility; modules describable with a simple noun or verb phrase without "and"
Canonical Sources¶
Stevens, Myers, Constantine, "Structured Design" (1974); Martin, "Clean Architecture" (2017)
Transfers To¶
Writing (paragraph unity), Product Design (feature grouping), Organizational Design (team structure), Data Modeling (table normalization)
Sub-concepts: - Functional cohesion: Highest - all elements contribute to a single task - Sequential cohesion: Output of one element feeds another - Temporal cohesion: Elements occur together in time (initialization) - Logical cohesion: Elements logically categorized together but functionally unrelated - Coincidental cohesion: Lowest - no meaningful relationship