Learn the vocabulary of translating a legacy system's concepts before they reach a clean domain model.
0 / 5 completed
1 / 5
At standup, a dev mentions a translation layer sitting between a clean new domain model and a legacy system's awkward concepts, so the legacy system's quirks never leak directly into the new model. What is this layer called?
An anti-corruption layer is a translation layer sitting between a clean new domain model and a legacy system's awkward concepts, so the legacy system's quirks, naming, and assumptions never leak directly into the new model's own vocabulary and structure. A read replica is an unrelated database scaling pattern. This translation is what lets a team build a genuinely clean new model without being permanently shaped by decisions baked into a legacy system it doesn't control.
2 / 5
During a design review, the team wants the anti-corruption layer to translate the legacy system's cryptic status codes into the new domain model's own clearly named states before that data ever reaches new domain logic. Which capability supports this?
A dedicated translation step converting legacy concepts into the new domain's own vocabulary at the boundary ensures the rest of the new domain logic only ever deals with clean, well-named states, never the legacy system's cryptic codes directly. Passing the legacy codes straight through with no translation step forces every consumer of that data to independently understand and correctly interpret the legacy system's quirks. This translation at a single, well-defined boundary is exactly what an anti-corruption layer is meant to centralize.
3 / 5
In a code review, a dev notices several unrelated parts of the new domain logic each directly check a legacy field's raw numeric status code, with no shared translation step in between. What does this represent?
This is missing anti-corruption layer coverage letting legacy concepts leak directly into the new domain logic, since several unrelated parts of the codebase are each independently interpreting the same raw legacy status code instead of relying on one shared, translated representation. A bounded context defines a domain model's boundary but doesn't itself describe this specific leakage pattern. Catching this in review matters because every place the raw legacy code leaks into becomes coupled to a system the team doesn't control and can't easily change.
4 / 5
An incident report shows a bug spread across a dozen unrelated features the moment the legacy system quietly changed the meaning of one status code, because every feature had directly coupled to that raw code instead of going through a shared translation layer. What practice would prevent this?
Introducing an anti-corruption layer that translates the legacy system's concepts once, at a single boundary, means a change to the legacy system's meaning only needs to be handled in one place, rather than tracked down across every feature that had directly coupled to the raw value. Continuing to let every feature interpret the raw legacy code independently is exactly what caused the bug to spread across a dozen features the moment the legacy meaning changed in this incident. This single-boundary translation is the standard defense against exactly this kind of widespread coupling.
5 / 5
During a PR review, a teammate asks why the team builds a dedicated anti-corruption layer instead of just letting new code call the legacy system's API directly wherever it's needed, which is faster to write initially. What is the reasoning?
Calling the legacy system directly from many different places couples the new domain model to every quirk of a system the team doesn't control, so a change on the legacy side can ripple unpredictably across the entire new codebase. A single translation layer isolates that coupling to one boundary, which is far easier to update in one place if the legacy system's behavior or meaning ever changes. The tradeoff is the upfront cost of designing and building that translation layer instead of just calling the legacy API directly wherever it happens to be convenient.