Posts tagged ‘java’

Project highlight: Architecture Rules

Architecture Rules (OV project page) is a Java open source framework licensed under Apache 2.0 that can be used to analyze your code. For the moment it can identify cyclic dependencies among project’s packages and classes.

Usually developers are concerned about the design principles at class level, but are not fully aware of packaging design principles. Robert Martin defined a couple of years ago, when OO was a buzzword, some packaging design principles. One of them is called “The Acyclic Dependencies Principle (ADP)” and states the following:

The dependencies between packages must not form cycles.

Usually in big projects cyclic dependencies are a common mistake. Just imagine that one developer defines a class structure, having in mind the package dependencies. Then another developer adds new classes, but just focuses on class design. After a few cycles/developers the project will reach a big messy macaroni package style with cycle dependencies.

I don’t know any mechanism to define package relation rules and I’ve never seen developers describing it in technical documents.

I think package coupling is as dangerous as code coupling. The end result is the same, reusing class modules becomes practically impossible. The bigger the project, more serious the threat of cyclic dependencies occurring.

Conclusion: Architecture Rules is a Java open source code analyzer able to assert that specific packages do not depend on others, able to find and report cyclic dependencies among a project’s packages and classes. On the next features list there are other rules to validate the code against, like “Separation of Concerns“. If more rules will be added to assert other design and architecture principles, ArchitectureRules can become as popular as FindBugs or PMD.

You can vote and sponsor the next features in the Architecture rules project, or propose your idea of a new feature:


If you want to find out more about Architecture Rules check the following links: