vishal patel
Applied in productionFoundationUpdated 2026-09-23

Coupling, Cohesion & Separation of Concerns

High cohesion inside a module, loose coupling between modules — the single most important property of a maintainable architecture.

modularityboundariesdddconnascence

Definitions

  • Cohesion: how strongly the things inside a module belong together. High is good. Things that change together should live together.
  • Coupling: how much one module needs to know about another. Low is good. Changes shouldn't ripple.
  • Separation of concerns: each part addresses one concern (UI, domain rules, persistence, transport).
diagram

Kinds of coupling (weakest → strongest)

  1. Message/event: you only know an event schema.
  2. Data: you pass plain values.
  3. Contract: you call a published API.
  4. Implementation: you know internal classes or tables.
  5. Shared database: the strongest and most dangerous; two services break each other's schema.

Also watch temporal coupling (A must be up for B to work) and deployment coupling (A and B must release together, which is a "distributed monolith").

Practical tests

  • Can I change module X's internal schema without editing module Y?
  • Does one feature request touch one module or five?
  • Can a team own this module end to end?

Sources & further learning

Videos, courses, docs and books I recommend for this topic.

Related topics