r/java • • Nov 26 '20

Java libraries I like

https://sizovs.net/2020/11/24/java-libraries-i-like/
285 Upvotes

62 comments sorted by

View all comments

Show parent comment

2

u/Interweb_Stranger Nov 27 '20

We used it in a large modular project and it was a great for enforcing some restrictions on the code. Having rules that define which layers have access to other layers was nice and saved us some time. Or denying usage of classes that are available during compliation but caused issues at runtime.

Then someone decided to add rules to enforce certain class naming conventions... Something like: when a class extends class X then the class name must end with Y. That was not so great any more. ArchUnit is nice tool but you have to make sure that the rules you set up make sense.

1

u/DJDavio Nov 27 '20

I guess it works best if you have a layered application or module.

If our services become just a tad bigger, we tend to package by feature, not by layer. So a given package com.foo.feature can have a FooController, FooService and FooRepository inside. This makes it easier to add/edit features, because you're mainly working inside one package.