Version the Edge, Not the Core
Medium About 40 min Katabench Pro
The refund use case takes and returns v1's wire types, v2 is built on top of the v1 controller, and v2's refund reason reaches the policy through a field bolted onto v1's request. Give the application a version-neutral command that carries what the policy needs, so each API version is a thin sibling adapter.
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 The Layer Skip, 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
- Layered architecture
- Keep transport, wire formats and versions at the edge and route calls through each layer.
Related katas
- The Layer Skip Medium Free A controller reaches past the application layer straight into infrastructure for the order total. Route the call back through the middle layer with a port the application owns; a thin pass-through that still touches infrastructure only moves the smell, it doesn't remove it.
- Keep HTTP at the Edge Easy Pro The returns application accepts a web request type directly, so transport points inward and the controller has no real use-case boundary. Map HTTP at the edge and drive an application-owned port.
- 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.
- Move the Port Home Medium Free A
*Portabstraction is declared beside its adapter, so the core reaches outward to see its own port. Move the single port into the core; duplicating it leaves a stray copy that fails the role-placement rule.