recall

← recall

anti-corruption layer pattern

When integrating with an external system whose model you can't control (legacy, vendor, partner), build a translation layer that converts their concepts into yours. Your domain stays clean; their weirdness stays at the boundary. The translation is the cost of independence.

When integrating with an external system whose model you can't control (legacy, vendor, partner), build a translation layer that converts their concepts into yours. Your domain stays clean; their weirdness stays at the boundary. The translation is the cost of independence.

symptoms

  • external concepts leaking into your domain code
  • changes in vendor model rippling through your codebase
  • inconsistent terminology between teams talking to the same vendor

causes

  • integrating without an explicit translation layer
  • vendor model adopted as-is for "speed"

fixes

  • build a translation layer (DTOs + mappers) at the boundary
  • document what concept maps to what
  • isolate vendor model in one module

you might say

  • ACL
  • wrap their API
  • translate at the boundary

related

aliases: ACL

topics: ddd, architecture, integration

references: