All glossary terms
Design

Anti-corruption layer

An anti-corruption layer is the translation boundary between two bounded contexts that prevents the model of one from leaking into the other. The ACL converts incoming external concepts into the consuming context's domain model and outgoing internal concepts into the format the external context expects, keeping each context's domain pure.

ACL is a classic DDD pattern most useful at integration boundaries — between your fresh domain model and a legacy system you must integrate with, or between two teams whose models have evolved independently. Without an ACL, the foreign model leaks: external field names appear in internal classes, external assumptions creep into business logic, and a change in the external system breaks code throughout your codebase. With an ACL, the foreign model is contained at the boundary; internal code speaks only the internal model. The cost is a layer of translation code that can feel duplicative until the first time the external system changes and the ACL absorbs the change cleanly.

Related terms