Allow working with sub application-modules or "aggregates" #577
lt-mayonesa
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey @odrotbohm et al, recently I had the opportunity of trying out
spring-modulith
on a service we built from scratch and I'm really liking it so far.We did introduce a small change that I'm really curious to know what you think: instead of just register
top-level
modules I modified a bit the unit tests to recursively register each module as atop-level
one, therefore enforcing the same dependency rules in anysub-module
. The code looks something like:In my opinion this a nice tweak since it aligns better with the concept of domain aggregates, and it helps keep a more cohesive code base - if not in the long run services will probably just have some big top level modules where they bunch everything together.
This is how the structure ended up (it's a small project):
WDYT? Would you consider this a correct approach?
Beta Was this translation helpful? Give feedback.
All reactions