Skip to content
BENIBIX Learn

Coupling

Development🏗️ ArchitectureArchitecture Basics

Also known as Loose Coupling, Tight Coupling, Decoupling

How much one part of a program leans on another.

Think of it like

Think of it like toys joined with glue or with clips. Clipped toys come apart easily.

Example

Jack's checkout code reads the payment firm's data straight from its API. When the firm changes its API, he must fix checkout too. That is tight coupling.

Why it matters

Loose coupling is what lets one team change their part without breaking everyone else's.

Definition

Coupling is how much one part of a program depends on another. Tight coupling means a change in one part forces changes in the other. Loose coupling means parts only know a little about each other, often through a small interface. Loosely coupled parts can be changed, tested and replaced on their own. Good design aims for loose coupling between parts.

Common mistake

Splitting code into many services that still share one table. They look apart, but they are tied tight.

Key takeaways

  1. 1
    Know little. About other parts.
  2. 2
    Talk through interfaces. Not inner details.
  3. 3
    Aim loose. Change one part alone.

Compare