← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Open Host Service & Published Language

Architecture Advanced
debt(d7/e7/b7/t5)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). The detection_hints list deptrac and phpstan as tools, but detecting a missing or poorly designed OHS — e.g., direct model imports across context boundaries, no stable API contract, shared databases — requires deliberate architectural review. Deptrac can flag cross-boundary dependencies but won't identify whether an OHS is missing or shaped by a single consumer's needs. Most violations are invisible until integration pain accumulates.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix describes publishing a stable public API with versioning, but the common_mistakes reveal deeper issues: decoupling the Published Language from the internal domain model, adding a versioning strategy, and redesigning consumer-shaped APIs all touch multiple bounded contexts and consumers simultaneously. This is a cross-cutting architectural correction, not a local fix.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'strong gravitational pull' (b7). The applies_to scope covers web and api contexts broadly. OHS defines the integration contract between bounded contexts — every upstream change, every new consumer, and every versioning decision is shaped by the OHS design. A poorly designed OHS (tightly coupled to internals, no versioning) imposes a persistent tax on all integration work across the system.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap — a documented gotcha most devs eventually learn' (t5). The misconception field directly states the trap: developers conflate OHS with 'having a REST API,' missing that OHS is an architectural decision about interface ownership and consumer relationships. This is a well-known DDD gotcha — common enough to be documented — but it doesn't contradict a strongly similar concept from another domain, keeping it at t5 rather than t7.

About DEBT scoring →

Also Known As

Open Host Service Published Language OHS DDD integration strategic DDD

TL;DR

A bounded context exposing a well-defined protocol (Published Language) for all downstream consumers — rather than custom point-to-point integrations for each.

Explanation

Open Host Service (OHS) defines a clear API contract (the Published Language) that downstream contexts use directly — typically an OpenAPI spec, event schema, or protocol buffer definition. All downstream contexts integrate using this one stable protocol rather than each negotiating a custom translation. Distinguished from Customer-Supplier: OHS publishes a general interface rather than tailoring it to each downstream. Distinguished from Shared Kernel: OHS is one-directional — upstream publishes, downstream consumes without tight coupling.

Common Misconception

Open Host Service and REST API are the same concept — OHS is a DDD strategic pattern about the relationship between bounded contexts; a REST API can implement an OHS but the OHS is the architectural decision about interface ownership.

Why It Matters

Without OHS, each upstream-downstream pair negotiates a custom integration — N contexts * M consumers = N*M custom integrations to maintain. OHS reduces this to 1 well-defined protocol serving all consumers.

Common Mistakes

  • Published Language tightly coupled to the internal domain model — decouple the public API representation from internal implementation
  • No versioning strategy for the Published Language — breaking changes break all consumers simultaneously
  • OHS shaped by one consumer's needs — the OHS should be designed for all consumers
  • Treating every outbound API as OHS — reserve for contexts with multiple consumers needing a stable general interface

Code Examples

✗ Vulnerable
// No Published Language — N custom integrations:
// Orders → Billing: custom internal format
// Orders → Shipping: different custom format
// Orders → Analytics: yet another format
// Adding new consumer: negotiate a new custom integration
// N consumers = N integrations to maintain forever
✓ Fixed
// Open Host Service — one stable Published Language:
// Orders publishes OpenAPI spec v1:
// GET /orders/{id} → { order_id, status, line_items, total }

// All consumers use the same protocol:
class BillingService {
    public function processOrder(int $orderId): void {
        $order = $this->ordersApi->getOrder($orderId); // Published Language
        // No custom translation layer needed
    }
}
// Adding new consumer: read the spec, integrate directly
// 1 protocol maintains instead of N

Added 16 Mar 2026
Edited 22 Mar 2026
Views 62
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping W 1 ping T 0 pings F 1 ping S 0 pings S 0 pings M 0 pings T 0 pings W 2 pings T 0 pings F 0 pings S 0 pings S 2 pings M 1 ping T 0 pings W 1 ping T 1 ping F 0 pings S 0 pings S 0 pings M 1 ping T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 1 ping M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Amazonbot 10 Perplexity 6 Ahrefs 4 Google 3 SEMrush 3 Scrapy 3 Unknown AI 2 Claude 2 Meta AI 1 Bing 1 Majestic 1 PetalBot 1
crawler 35 crawler_json 2
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: High
⚡ Quick Fix
When other bounded contexts need your data, publish a stable public API (Open Host Service) with versioning — don't let consumers access your database or internals directly
📦 Applies To
any web api
🔗 Prerequisites
🔍 Detection Hints
Bounded context sharing its database with another context; no stable API contract between contexts; direct model imports across context boundaries
Auto-detectable: ✓ Yes deptrac phpstan
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: High Context: File Tests: Update


✓ schema.org compliant