Now that we covered the very basics of structure analysis with STAN, let’s dive a little deeper and learn about some common design principles, their associated metrics and visualizations.
Acyclic Dependencies Principle
Cycled components can only be used together. They can only be tested, reused, deployed and understood together. The bad thing with cycles is that every node on a cycle depends on any other. Having lots of cycles lets explode the number of indirect dependencies within the system. Without early intervention, the system starts to rot.
We should therefore avoid dependency cycles within the design layer (libraries, packages, package trees). This is known as the Acyclic Dependencies Principle:
The dependency graph of packages or components should have no cycles.
Stable Abstractions Principle
Robert C. Martin proposed the idea that for well designed software there should be a specific relationship between two package measures: the abstractness of a package, which shall express the portion of contained abstract types, and its stability, which indicates whether the package is mainly used by other artifacts (stable) or if it mainly depends on other artifacts (instable).
The desired relationship is captured in the Stable Abstractions Principle:
A package should be as abstract as it is stable.