# Anti-Corruption Layer

Record: `arch:anti-corruption-layer`
Kind: pattern
Layer: [Domain Modeling](https://banes-lab.com/records/layer/domain-modeling.md)
Severity: recommended
Scope: integration, bounded context boundary
Canonical: https://banes-lab.com/ontology#arch-anti-corruption-layer

## Repair

- Refactored by: Add Translator, Add Adapter, Introduce Boundary DTO
- Detected by: external DTOs used in domain layer
- Violated by: external model leaking into domain
- Measured by: leakage count, adapter coverage
- Enforced by: import rules, layer tests

## requires

- [Explicit Boundary](https://banes-lab.com/records/lex/explicit-boundary.md)
- [Translation Model](https://banes-lab.com/records/lex/translation-model.md)

## reinforces

- [Domain Purity](https://banes-lab.com/records/lex/domain-purity.md)
- [Low Coupling](https://banes-lab.com/records/arch/low-coupling.md)

## enables

- [Legacy/System Integration](https://banes-lab.com/records/lex/legacy-system-integration.md)

## conflicts-with

- [Shared Model Coupling](https://banes-lab.com/records/lex/shared-model-coupling.md)
- [Vendor Lock-In Leakage](https://banes-lab.com/records/arch/vendor-lock-in-leakage.md)

## tensions-with

- [Mapping Overhead](https://banes-lab.com/records/lex/mapping-overhead.md)

## tensions

- [Anti-Corruption Layer Mapping Overhead](https://banes-lab.com/records/tension/anti-corruption-layer-mapping-overhead.md)

## contracts

- [Anti-Corruption Layer Over Cross-Context Leak](https://banes-lab.com/records/algo/no-leaky-context.md)

## referenced-by

- [Context Mapping](https://banes-lab.com/records/arch/context-mapping.md)
- [Adapter Pattern](https://banes-lab.com/records/arch/adapter-pattern.md)
