“Whole life have balance, everything be better. Understand?” — Mr. Miyagi, The Karate Kid
To illustrate the interplay of the dimensions of coupling, let’s start with the first two—integration strength and distance—and analyze their extreme combinations.
Low Strength, High Distance
High distance increases the cost of co-evolving coupled components. However, low integration strength minimizes the likelihood of cascading changes. Low integration strength balances high distance. As a result, this relationship is what we usually call loose coupling.
High Strength, Low Distance
Here, the components share a large amount of knowledge, and reducing it is not feasible—for example, when they implement closely related business functionalities. High integration strength is balanced by low distance: the components must co-evolve, but cascading changes are not costly to implement. This relationship represents high cohesion.
Low Strength, Low Distance
This scenario is trickier. Cascading changes are inexpensive due to low distance, but they are also unlikely because of low integration strength. As a result, we have a set of unrelated components located close to each other—a state known as low cohesion.
From a complexity perspective, this increases cognitive load, as developers must navigate through unrelated components to find the one that needs modification. If only a few unrelated components exist, the impact is negligible. However, as their number grows, the design drifts toward a big ball of mud.
High Strength, High Distance
In this case, the components frequently change together (high integration strength), and each change is expensive (high distance). This is what is typically called tight coupling—or a step toward a distributed monolith.
From a complexity standpoint, each change requires significant cognitive effort to locate and modify distant parts of the system that must change together, increasing the risk of missing dependencies.
Complexity or Modularity
The interplay between extreme combinations of integration strength and distance allows us to define modularity and complexity:
- Modularity: Integration strength and distance balance each other (one is high, the other is low).
- Complexity: Integration strength and distance are equal (both high or both low).
Thus, modularity and complexity can be expressed as binary expressions:
MODULARITY = STRENGTH XOR DISTANCE
COMPLEXITY = STRENGTH AND DISTANCE
Pragmatic Balance
As Eric Evans put it, not all of a large system will be well designed. Sometimes, cutting corners is necessary. The dimension of volatility introduces pragmatism into the design decision-making process.
If a component shares a large amount of knowledge but is not expected to change—for example, a legacy system that is no longer evolving—the effects of shared knowledge are balanced by its low volatility. Thus, the balance of coupling can be expressed as:
BALANCE = (STRENGTH XOR DISTANCE) OR NOT VOLATILITY
Note: For brevity, this article uses a simple binary model to demonstrate the interplay of coupling dimensions. In Balancing Coupling in Software Design, you will find a more elaborate mathematical model.
Learn More
- Balancing Coupling in Software Design, Chapter 10: Balancing Coupling
- Balancing Coupling in Software Design, Chapter 11: Rebalancing Coupling
- Balancing Coupling in Software Design, Chapter 12: Fractal Geometry of Software Design
- Balancing Coupling in Software Design, Chapter 13: Balanced Coupling in Practice