Chapter 7. Integration of Bounded Contexts
In Chapter 5, you read about domain-driven design’s patterns for defining integrations between bounded contexts. In this chapter, we’ll talk briefly about those patterns from a tactical design perspective.
Anticorruption Layer
This pattern protects the downstream context from the inconvenient model exposed by the upstream context. It translates the service’s provider’s model into a model driven by the consumer’s needs. Such translation can be implemented in different ways:
- Local cache
-
The downstream consumer can implement a job that fetches data from the upstream service, transforms it, and stores the result in a local cache. If needed, this cache can be wiped and regenerated from scratch.
-
This approach is very similar to the implementation of projections in the CQRS architecture.
- Adapter service
-
The downstream consumer can proxy all requests to the upstream service through a custom service. The adapter will call the upstream context, transform the result, and ...
Get What Is Domain-Driven Design? now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.