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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access