Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.9 KB

Anti_Corruption_Layer.md

File metadata and controls

43 lines (34 loc) · 1.9 KB

Anti-Corruption Layer (ACL)

Motivation

  • When systems based on different models are combined, the need for the new system to adapt to the semantics of the other system can lead to a corruption of the new system’s own model.

Solution

Concepts

  • Place an adapter layer between 2 domain models and translate communications between them.

Implementation

  • General advices
    • The anti-corruption layer can be implemented as a component within the application or as an independent service.
    • The anti-corruption layer can be bidirectional.
    • Functionality can be added to the anti-corruption layer if it is specific to the relationship of the two subsystems, like audit log or trace logic.

Pros & Cons

Pros

  • Improve the isolation and reduce the friction between the 2 domain models.

Cons

  • May add latency to calls made between the 2 domain models.

Consideration

When To Use

Two or more domain models have different semantics, but still need to communicate.

References