Anti-Corruption Layer
ELI5 — The Vibe Check
An anti-corruption layer is a translator between two systems that speak different languages. When the legacy system sends you garbage data models, the ACL cleans it up before it infects your shiny new domain. It's a bouncer that keeps bad models out.
Real Talk
A DDD pattern that creates an isolating layer between a new system and a legacy or external system to prevent the foreign model from corrupting the internal domain model. The ACL translates, adapts, and maps between the two systems' models, protecting the integrity of each bounded context.
When You'll Hear This
"Build an anti-corruption layer so the legacy ERP's data model doesn't leak into our new service." / "The ACL transforms the vendor API's XML responses into our clean domain objects."
Related Terms
Adapter Pattern
You're in Europe with a US charger. You need an adapter. In code, your app expects a PaymentProcessor with a .pay() method, but the new Stripe SDK uses .
Bounded Context
A bounded context is a boundary where a particular model and language applies. 'Customer' means one thing in Sales and something different in Shipping.
Context Mapping
Context mapping is drawing the diplomatic map of your system — which bounded contexts exist, how they relate, and who's in charge.
Domain-Driven Design (DDD)
DDD says your code should speak the same language as the business.