Course contentsShow
← Software Engineering
Lesson 1282 of 1,93338. Layered and Modular ArchitectureFree lesson

Context Mapping Patterns

Understanding relationships between bounded contexts: Shared Kernel, Customer-Supplier, Conformist, and Anti-Corruption Layer.

Context Mapping Patterns

You'll learn how bounded contexts relate to each other and the patterns that define these relationships.

What Are Context Mapping Patterns?

Once you've identified your bounded contexts (as in the previous lesson), you need to understand how they interact. Context Mapping Patterns describe the relationship types between different bounded contexts in your system. These patterns help you make explicit decisions about integration strategies, team dependencies, and data flow.

Think of bounded contexts like neighboring countries—they need treaties, trade agreements, and border policies to work together smoothly.

The Core Patterns

Shared Kernel

Two contexts share a small, common subset of their domain model. Both teams must coordinate changes to this shared code. Like roommates sharing a kitchen—you both use it, so you need to agree on how to keep it clean.

Customer-Supplier

One context (supplier) provides services to another (customer). The supplier team's priorities may not align perfectly with the customer's needs, but they negotiate. Similar to a vendor relationship where the customer has influence but not full control.

Conformist

The downstream context conforms entirely to the upstream context's model, even if it's not ideal. You accept their terms completely—like using a third-party API exactly as documented, with no adaptation layer.

Anti-Corruption Layer (ACL)

The downstream context builds a translation layer to protect its model from the upstream's influence. This isolates your clean model from external complexity. Like a diplomatic translator who ensures your government officials never have to speak the other country's language directly.

Key Takeaway: Context Mapping Patterns make integration relationships explicit, helping teams choose appropriate coupling levels and maintain clean boundaries between bounded contexts.