Dependency Cycle

Detect Dependency Cycle

The easiest way to keep a code base clean is to avoid dependency cycles between its components. Components are useful to partition a huge amount of code into smaller and understandable pieces. If a dependency cycle involves N components, these N components represent a single super-component. Indeed, the benefits of having N smaller components are lost: any component can be potentially broken by a change in any of the others components, you cannot unit test a component in isolation from the N-1 other ones and finally, all N components must be versioned and deployed all together.

Whether you consider that your components are classes, packages, Projects or a mix in between, VBDepend detects dependency cycles between them. It can also help you to find the right way to get rid of a particular dependency cycle. Once dependency cycles have been removed, VBDepend can continuously check your code base to warn you as soon as a cycle is accidentally created.

Dependency Cycle

White paper: Control component dependencies

Related Link:
Control component dependencies to gain clean architecture.
Keep your code structure clean.
Layering, the Level metric and the Discourse of Method.