Conformist
In Domain-Driven Design (DDD), Conformist is a strategic context mapping pattern that describes a specific relationship between an Upstream (the provider) and a Downstream (the consumer) Bounded Context.
In this relationship, the Downstream team chooses—or is forced—to conform to the Upstream team’s domain model. Instead of creating an Anti-Corruption Layer (ACL) to translate the Upstream's terms into their own, the Downstream team uses the Upstream’s models, terms, and logic directly in their own context.
Why use the Conformist pattern?
The Conformist approach is typically adopted when:
- Upstream Power: The Upstream team is very powerful or "too big to care" (e.g., a massive legacy system, a huge internal platform, or a giant third-party API like Amazon or Google). They won't change their model for you.
- Resource Constraints: The Downstream team doesn't have the time or budget to build and maintain a complex Anti-Corruption Layer.
- Model Compatibility: The Upstream’s model is actually "good enough" or very close to what the Downstream needs anyway.
Comparison: OHS vs. Conformist
While the Open Host Service (OHS) pattern focuses on the provider making life easier for consumers, Conformist focuses on the consumer surrendering to the provider's model.
| Feature | Open Host Service (OHS) | Conformist |
| Control | Upstream provides a stable, public contract. | Upstream dictates the model; Downstream follows. |
| Complexity | Higher for Upstream (must maintain the API). | Higher for Downstream (must adapt to Upstream's changes). |
| Domain Purity | High. Downstream maintains its own language. | Low. Downstream's model is "polluted" by Upstream. |
| Best For | Strategic core services with many consumers. | Integrating with unchangeable or dominant systems. |
Cinema Ticketing Example: The Payment Gateway
Imagine your Booking Context (Downstream) needs to integrate with a global Payment Provider like Stripe (Upstream).
Stripe has its own Ubiquitous Language: Charge, Source, Refund, and IdempotencyKey.
- If you act as a Conformist: You don't create your own
Paymententity. Instead, you use Stripe'sChargeobject throughout your Booking logic. If Stripe changes their SDK or their logic, your Booking code might break because you are tightly coupled to their model. - If you used an ACL: You would map Stripe's
Chargeto your own internalCinemaPaymentobject.
Code Implementation (.NET Core)
In a Conformist relationship, the Downstream project often adds a direct reference to the Upstream's library or SDK and uses those classes inside its own Service layer.
Summary of the "Trade-off"
The Conformist pattern is a pragmatic choice. It saves development time upfront (no translation logic needed), but it introduces a high risk of technical debt because any change in the Upstream system ripples directly into your Downstream business logic.
Would you like to see how to transition from a "Conformist" approach to an "Anti-Corruption Layer" (ACL) as a system grows?