liveBook · Manning

Anticorruption layer

As explained in Architecture Modernization: Socio-technical alignment of software, strategy, and structure

An anticorruption layer is an integration boundary that translates between a new model and an external or legacy model to prevent the latter's concepts from contaminating the former.

An anticorruption layer (ACL) translates between a new domain model and a legacy model. It lets a new subsystem use its own concepts while still relying on older functionality. In a bubble migration, the new subsystem handles some logic itself and delegates the rest through the ACL. As more logic moves into the bubble, reliance on the legacy subsystem can shrink. section 12.4.2

Keeping a gigs platform running

A gigs platform first modernized its code while new and existing models still shared a database schema. As bounded contexts gained separate persistence schemas, an ACL kept the old model updated. When the new job-drafting and job-fulfillment contexts published a Job Published domain event, the ACL intercepted it and created a job in the legacy model. The old functionality remained operational while the team introduced changes gradually and A/B tested them. section 12.5

Figure 12.30 How the old legacy model is synced and updated through domain events from the new bounded context. The ACL is subscribed to the new domain events and then creates legacy jobs in the old legacy model.

Follow the event from the new bounded context through the ACL to the legacy job model to see where translation occurs. section 12.5

Treat the ACL as a migration cost, not a free boundary. Its translation logic can become more complex than the domain model it protects. Before choosing a bubble, weigh that cost against the freedom to evolve a fresh model. If the cost is too high, addressing the legacy subsystem directly—or conforming to its model—may be more practical. section 12.4.2

How Architecture Modernization: Socio-technical alignment of software, strategy, and structure covers it

How deep it goes
Defines model translation and works through domain-event integration and migration trade-offs, without specifying translation code.
Examples
Uses a gigs platform where an ACL turns a Job Published domain event into a job in the legacy model.
What it assumes
Introduces the ACL as a translator while using domain-model, bounded-context, and domain-event vocabulary.
What you can do after
Evaluate/understand it as a migration boundary by weighing model independence against the complexity of translation.
How it connects
Connects bubble contexts, autonomous bubbles, bounded contexts, domain events, and legacy-system migration.

Also explained in

Compare how 3 books explain anticorruption layer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecture Modernization: Socio-technical alignment of software, strategy, and structure. The section links point to the parts of the book it draws on.