Split the God Port
Hard About 40 min Katabench Pro
One fat warehouse interface serves a consumer that only reads and a consumer that also reserves, so reporting can see a method it must never call. Splitting the interface is not enough: each half needs its own published namespace, and the behavior tests force one implementation behind both.
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
- Interface segregation
- Split fat interfaces so clients depend only on what they use.
Related katas
- Make the Membership Contract Honest Hard Free An abstract Membership promises renewal even though lifetime memberships cannot renew, forcing RenewalService to recognize a concrete subtype before it can safely use the base contract. Split shared membership identity from the renewable capability, remove the lying inheritance, and make the service depend only on what it can honestly call.
- Shrink the Machine Interface Medium Free One fat IMachine interface forces the inkjet printer to fake a Scan it cannot perform, and the print queue to demand a scanner it never uses. Split the roles into IPrinter and IScanner. Keeping IMachine around as a composed sub-interface leaves the inkjet transitively welded to scanning and two rules red.
- 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.
- Config Is Infrastructure Medium Free The shipping core reads a framework configuration type directly, welding the domain to infrastructure. Invert it behind a core-owned options port, and don't just rename the framework wrapper into the core, which trips a second rule.