How Does This Help Me Build Maintainable Software?
Software architecture is basically all about managing dependencies between architecture elements. If the dependencies become a big ball of mud, the architecture becomes a big ball of mud.
So, to preserve the architecture over time, we need to continually make sure that dependencies point in the right direction.
When producing new code or refactoring existing code, we should keep the package structure in mind and use package-private visibility when possible to avoid dependencies on classes that should not be accessed from outside the package.
If we need to enforce architecture boundaries within a single build module, and the package-private modifier doesn't work because the package structure won't allow it, we can make use of post-compile tools such as ArchUnit.
And anytime we feel that the architecture is stable enough, we should extract architecture elements into their own build modules because this gives explicit control over the...