On this page
Modularity, Cohesion & Coupling
Prev: software_design | Up: software_design | Next: Error-Handling Philosophies
Rel: Computational Thinking & Abstraction, Object-Oriented Programming
Ref: Wikipedia — Cohesion (Computer Science)
Tags: #public #prog #programming #design
Contents
High Cohesion & Low Coupling
- High cohesion: everything inside a module belongs together and changes for the same reason.
- Low coupling: modules interact through small, stable interfaces rather than reaching into each other's internal state.
Dependency Inversion & Explicit Boundaries
Pass dependencies (database connections, clocks, HTTP clients) into functions or constructors rather than hardcoding globals inside them. This decouples business logic from infrastructure and makes unit testing trivial without monkey-patching.
Linked from
Related notes
- tuts/programming/software_design Linked here; links to this page; shared tags: #design, #prog, #programming
- tuts/programming/software_design/error_handling_philosophies Linked here; links to this page; shared tags: #design, #prog, #programming
- tuts/programming/foundations/computational_thinking_and_abstraction Linked here; links to this page; shared tags: #prog, #programming
- tuts/programming/paradigms/object_oriented_programming Linked here; links to this page; shared tags: #prog, #programming
- tuts/programming/software_design/testing_and_maintainability shared tags: #design, #prog, #programming
- tuts/programming shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa/complexity_and_big_o shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa/linear_and_hashed_structures shared tags: #prog, #programming
- tuts/programming/algorithms_and_dsa/problem_solving_patterns shared tags: #prog, #programming