Quarantine the Legacy
Medium About 30 min Katabench Pro
The billing core calls a legacy ledger that speaks in public string fields and cent amounts, and parses its rows inline. Build an anti-corruption layer: one adapter owns the translation, and the core's allowlist catches any port that still leaks the legacy dialect.
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 Config Is Infrastructure, 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
- Anti-corruption layer
- Translate a legacy or external model at the boundary, and replace it incrementally behind that port.
Related katas
- Strangle Behind the Port Medium Pro A pricing core chooses between legacy and replacement tax engines itself, so a temporary migration decision has become permanent domain coupling. Put coexistence behind one core-owned port and let an outer adapter route the strangler migration.
- The Leaky Payment Port Hard Free A checkout service is welded to a Stripe client and passes vendor DTOs around. Someone half-extracted an IPaymentGateway port, but it leaks Stripe types through its own signature. Make the port vendor-neutral with a real anti-corruption layer, not an interface that smuggles the SDK through.
- 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.