Own Your Data Boundary
Hard About 45 min Katabench Pro
Billing bypasses Orders' published surface and reads its internal database rows directly. Route the question through an Orders-owned query API, but do not mistake a port that returns the private row for a real boundary.
The full brief is part of Katabench Pro
Pro opens this kata's brief, its starter code and its grader. To see how the track works first, try Break the Checkout Cycle, which is free.
How it is graded
You work across multiple files, and architecture rules turn the design boundaries into executable feedback.
What it practices
- Modular monolith
- Modules talk through published contracts and own their data, never each other's internals.
Related katas
- Break the Checkout Cycle Hard Free Orders, Pricing and Promotions import each other in a three-hop cycle while Pricing also reaches into Inventory's internals. Moving the obvious call only rotates the cycle; hoist the shared vocabulary into a kernel leaf and reach Inventory through its published port to turn every rule green.
- Funnel Through The Bus Hard Pro Orders calls Billing's and Notifications' internals directly while both peek back into Orders' internals, breaching the module boundaries and closing two cycles. A published bus and event already exist but sit unused. Republishing through the bus clears the direct calls and the cycle, yet the subscribers still reach into Orders to format their lines; only a fat-enough event turns every rule green.
- The Shared Kernel That Wasn't Hard Pro Support routes tickets off a tier it reads straight out of Sales's private Customer entity. Decouple the two features through the shared kernel, but publishing the fat entity isn't sharing, it's fusing.
- Compose Modules, Not Their Internals Medium Pro In a clinic's modular monolith, Appointments holds Billing's internal invoice book and the host news up module internals by hand, while Pharmacy already bills through a contract. Compose every module through its entry point, and keep every invoice number unique across the clinic day, whichever module asked for it.