A module is a separately organized application unit that owns a coherent business domain and hides its internal model, rules, and implementation behind an interface. Its purpose is to control complexity as systems grow: clients collaborate through a small contract instead of learning the whole domain. A deep module delivers substantial functionality through a simple API; a shallow one exposes nearly as much complexity as it contains. section 1.2.6 section 7.1
A deep module concentrates complex capabilities behind a thin API layer, so consumers depend on the contract rather than its internal machinery. section 7.1
Design modules to reduce the cost and reach of change:
- Align a module with a business domain. A new invoice rule should primarily change the Invoice module, not Delivery. section 7.1.1
- Keep components that routinely change together in the same module, where shared builds and tests can reveal incompatible changes. section 7.1.3
- Expose an interface that is easy to use and does not reveal whether work uses a database, cache, or another module. section 7.2.1
- Keep public contracts stable and backward compatible when independently maintained clients cannot update in lockstep. section 7.2.2
- Offer extension points when customization is expected, but avoid abstracting every current company-specific decision. section 7.2.3 section 7.2.4
Billing, delivery, and inventory
An e-commerce system can place charging and invoices in Billing, shipment rules in Delivery, and stock decisions in Inventory. Delivery consults Inventory before shipping, while Billing notifies Delivery when an invoice is paid. Each collaboration needs a clear contract, allowing a team to improve one module without automatically forcing changes through the others. section 7.0 section 7.1
Modularization is not permission to create countless tiny units. Watch the dependency web: coupling to another module’s internal classes makes internal refactoring dangerous, expands the impact of changes, and can lengthen builds. Document the supported API, keep clients away from leaked details, and use architectural constraints where appropriate. Good boundaries are practical choices that must be monitored and improved over time. section 7.3 section 7.3.2 section 7.3.3


































