Coupling and cohesion
How much parts depend on each other, and how well each part holds together.
Low coupling means a change in one place rarely forces changes elsewhere. High cohesion means related things live together. Together they predict how expensive the next change will be.
Why it matters for a product engineer
Coupling is how much one part depends on another. With low coupling, a change in one place rarely forces changes elsewhere. Cohesion is how well each part holds together: related things live together. Together they predict how expensive the next change will be, and how many people must agree before it ships.
How to do it
- Before a change, list what else must change with it. A long list is a measure of coupling.
- Keep things that change together in the same module, and things that change for different reasons apart.
- Depend on small, stable interfaces, not on another part’s internals or data.
- When you must change shared code, prefer an additive change: a new option, a new attribute, a new function. Keep the old behaviour the same.
- Make each change to shared code visible, so its owners can review it.
- Watch for shared libraries and shared database tables. They are where hidden coupling grows.
Common mistakes
- A “utils” module that everything imports and nobody owns.
- Two features that read and write the same data in different ways.
- Copying code to avoid coupling, then fixing the same bug in five places.
- Changing a shared component’s default behaviour for one new use.
Example
In November 2026, RelievApp asked agents to build new versions of its home page on the same code as the classic site. Each version had its own folder for pages, copy and styles. Its styles were scoped to the version, so shared screens such as check-in and the paywall took the new look without copies. For shared files, the brief set a strict rule. (RelievApp in In practice)
RelievApp's rule for changing shared code
Shared files (src/components/**, src/lib/**, src/app/**, src/styles/globals.css) are shared with the classic site and the other version.1Prefer not to touch them.2If you truly need a hook in a shared file, make the smallest additive change (an optional prop, a data- attribute, a class name),3keep classic behaviour identical,4and list it in your report.5
- 1The couplingNamed, with paths
- 2The default
- 3How to changeAdd, never alter
- 4The test
- 5VisibilitySomeone can review it
The rule does not forbid coupling. It keeps each change to shared code small, additive and visible.
ObservedRelievApp's brief for a new home page version, 15 Nov 2026
Sources: Monolith first (Martin Fowler) ↗
Resources
1- articleStart here
Monolith first ↗
Martin Fowler · 2015 · 6 minWhy most successful systems start as one well-structured application and split only when boundaries are clear.