Anti-Corruption Layers for Third-Party APIs
Protect your clean domain from messy external models by building an anti-corruption layer that translates foreign concepts into your own.
When the Outside World Is Messy
Repositories and gateways shield you from where data lives. But external APIs also impose their own vocabulary and shape — often inconsistent or poorly designed.
An Anti-Corruption Layer (ACL) stops that mess from leaking into your domain.
The Concept
The term comes from Domain-Driven Design. An ACL is a translation boundary between your model and a foreign model.
- Your core speaks its own language.
- The ACL converts to and from the external language.
All lessons in this course
- The Repository Pattern in Clean Arch
- Gateway Interfaces for External Systems
- Data Mappers and DTOs
- Anti-Corruption Layers for Third-Party APIs