Uncle Bob’s Advice on Stability and Abstraction

Emanuel Trandafir
Javarevisited
Published in
4 min readSep 11, 2022

--

My brief and concise summary of Uncle Bob’s old Clean Code series. Namely, the episode about Acyclic Dependencies, Stable Dependencies, and Stable Abstraction Principles.

1. Acyclic Dependencies Principle

The Acyclic Dependencies Principle states that dependencies between components must not form a cycle.

Photo by niloy tesla on Unsplash

For instance, for the system represented in the diagram below, Module A depends on Module B, which depends on Modules C and D. But, Module D depends on Module A, which creates a cycle in the dependency structure.

violation of the Acyclic Dependencies Principle

As a result, the system will no longer be independently developable and deployable.

To comply with the Acyclic Dependency Principle, we must ensure that dependencies in our system are pointing in the same direction, forming a directed acyclic graph.

In our case, we have two solutions to achieve this:

Solution 1 — Create a new component

--

--

Emanuel Trandafir
Javarevisited

Hi, I'm Emanuel Trandafir, a Java developer from Romania. I have a strong passion for clean code, software design, and unit testing.