Open Host Service is the strategic Domain-Driven Design answer to integration at scale: instead of negotiating one bespoke translation per consumer, the upstream context opens one well-defined protocol for any consumer. Its companion pattern, Published Language, supplies the vocabulary — a documented, versioned shared model for every request, response, and event. Evans introduces them as a pair, and practice applies them as one: an open protocol without a shared language degenerates into ad-hoc payloads.
The pattern is the upstream mirror of the Anti-Corruption Layer: the host shields consumers from its internal model, rather than each consumer shielding itself.
How It Works
- The upstream context defines one service protocol, open to every consumer — current and future.
- Requests, responses, and events use the published language: a documented, versioned schema (e.g. OpenAPI, JSON Schema, Avro) or an industry standard (e.g. FHIR, iCalendar).
- A translation layer inside the host maps the internal domain model to the published language; internal types never cross the boundary.
- A versioning and deprecation policy governs evolution; consumers rely on the language and its documentation alone.
Failure Modes
- The published language is generated from internal types, so every internal refactoring becomes a breaking contract change.
- Per-consumer special cases creep into the protocol, recreating N bespoke integrations under one name.
- Evolution without a versioning policy forces a lockstep upgrade of every consumer at the first breaking change.
- Translation mappings lag behind internal model changes; consumers receive structurally valid but semantically wrong data.
Verification
- The integration log shows zero host-side code changes for the last N consumer onboardings.
- Contract tests pin the published schema; internal refactorings pass them unchanged.
- A schema diff in CI flags every breaking change and rejects unversioned ones.
Variants and Related Tactics
- Anti-Corruption Layer is the downstream mirror: the consumer translates because the upstream offers no clean protocol.
- A standalone published language — an industry standard such as FHIR — can serve several hosts at once.
- Consumer-driven contract testing checks the published language against real consumer expectations.
References
- Domain-Driven Design: Tackling Complexity in the Heart of Software, ch. 14 — Eric Evans (Addison-Wesley, 2003)
- Implementing Domain-Driven Design — Vaughn Vernon (Addison-Wesley, 2013)
- Context Mapping — DDD Crew