Uncle Bob’s Advice on Stability and Abstraction
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.
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.
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: