Project Structure
The goal of the structure is to increase discoverability of the codebase and to localize changes of a PR to a single directory.
Package-by-Feature instead of Package-by-Layer
Java projects are structured into packages. UTURN has traditionally dedicated packages to specific layers (controllers, services, repositories, etc). Some of our largest packages now have hundreds of classes, which is completely unworkable and prevents anybody from getting an overview of what our coed actually does. The only way to understand a single feature, is to understand the entire codebase. Feature cannot at the moment be easily understood or reasoned about in isolation.
Instead, we will package our code by feature(shipment, quote, organization, etc). The advantages are that we can code that relates to our feature will live nearby, in the same packages, thereby enabling code discoverability. Since most code changes are changes to features, they are more likely to only impact a single package, thereby localizing changes.
Out-of-scope
- This document does not mandate a specific structure inside each package.
- This document does not comment on the max size or other restrictions of each package.
- This document does not comment on the exact packages to adopt.