Component Coupling

Clean Code, Episode 17

By Uncle Bob

60 minFeb 2013

Stop all that giggling and get your minds back out of the gutter. It's Component Coupling people, Component Coupling.

In this video our intrepid cast of characters will explore the principles that govern the relationships between components. Those principle are:

  • The Acyclic Dependencies Principle.
  • The Stable Dependencies Principle.
  • The Stable Abstractions Principle.

In this lesson we'll learn about the Morning After Syndrome, that hideous disease that affects large teams and causes them to step all over each other. We'll show how a large system can be safely and effectively managed by keeping the dependencies between the components free of cycles.

Then we'll take a look at the concept of stability. What makes a component stable, and why should we care? What effect does stability have on the dependencies between components?

Then we'll look at abstractness. What makes a component abstract? How does abstractness impact on the couplings between components?

Then we tie it all together. What is the relationship between stability and abstractness? How can we use that relationship to free our stable components from rigidity?

Finally, we boil it all down into numbers and metrics. We derive a set of simple mathematical expressions that describe the relationships between components, and provide numeric measurements of how well those components conform to some of the SOLID principles.

So, don your enchanted armor, get your iron picks and diamond swords ready, and get out of bed, because the sun is about to rise on the world of Component Coupling.