Posts

Showing posts from February, 2018

Control package dependencies with Checkstyle

Image
You want the internal structure of the code inside a component to keep its shape during development. The chosen development approach, like Domain Driven Design , gives you design guidelines for shaping the component, including dependency rules (E.g. domain model to not depend on infrastructure). Bigger the project, harder is to catch package dependency violations using standard practices like code reviews. At a higher level, the dependencies between components are easier to control. For example, you can rely on Maven dependencies which means problems are caught at compile time. But inside a component, even if you go smaller - with one microservice per bounded context, non-trivial domains will contain a considerable number of classes and packages. The solution is to implement a quality gateway for this architectural aspect, aka defining a Fitness Function according to the book Building Evolutionary Architectures . The book contains examples with JDepend  but I found it very har...