Architecture Practice

Coupling

Also known as: tight coupling, loose coupling, afferent and efferent coupling

Definition

Coupling is the degree to which one component depends on the internals of another, measured by how much of it must change when the other changes. Low coupling is not the goal in itself — the goal is that changes stay local, and coupling is the property that decides whether they do.

Last reviewed · Part of the Architecture Glossary

In practice

Types, worst to best:

TypeExampleChange blast radius
ContentReaching into another module's private state or tableEverything
CommonShared mutable global or shared database tableEvery writer
ControlPassing a flag that switches the callee's behaviourBoth sides, always together
StampPassing a whole object when one field is neededCallee couples to the whole shape
DataPassing exactly the parameters neededLocal

Two measurements worth automating as fitness functions:

  • Afferent coupling (Ca) — how many modules depend on this one. High Ca means it is hard to change; it needs a stable interface.
  • Efferent coupling (Ce) — how many modules this one depends on. High Ce means it is fragile; it breaks when any of them move.

Temporal coupling is the one that hides in distributed systems: service A cannot complete without service B being up right now. Asynchronous messaging removes it; a synchronous call chain multiplies it into the availability arithmetic.

When it matters

Every boundary decision, every shared-library proposal, every "let's just query their table" shortcut.

Common mistake

Chasing zero coupling. Components that never interact do nothing useful together; the aim is appropriate coupling — data-level, versioned, and explicit — not none.

See also

Go deeper