Anti-corruption layers
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
protect a clean model from a legacy or third-party model.
Planned topics
- An anti-corruption layer (ACL) translates between the foreign model and your own at the boundary.
- It isolates vendor naming, quirks, and failures so they do not spread.
- Use it when the external model is poor, volatile, or hard to replace.
- It costs code and a team's attention; skip it when the external model fits well.
Draft outline details
Demonstration
a layout: domain code calls a CarrierGateway interface; an adapter maps carrier statuses to the domain's ShipmentStatus and handles errors and retries.
Check your understanding
When is an ACL not worth building?
Show answer
When the external model already fits your domain and is stable.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.