Translate between new domain model and legacy/external model
Placement
Adapter layer inside new service or as standalone gateway
Benefit
Protects new bounded context from legacy concepts leaking in
Cost
Extra translation code; small latency
Example: ACL Wrapping Legacy SOAP
public class LegacyCustomerAcl { private final LegacyCustomerSoapClient legacy; public Customer getCustomer(CustomerId id) { LegacyCustDTO raw = legacy.fetchCust(id.value()); return new Customer( new CustomerId(raw.getCustNo()), raw.getFName() + " " + raw.getLName(), Email.of(raw.getEmailAddr())); }}
9. Separate Front and Backend Services
Layer
Responsibility
Frontend Service (BFF)
Aggregates backend APIs for a specific UI client
Backend Service
Owns business capability and data
Why Separate
UI changes are frequent; backend capabilities are stable
Trade-off
Extra hop; mitigated by colocation/caching
10. Understanding Decomposition Trade-offs
Decision
Cost
Benefit
More services
Network ops complexity
Independent deploy/scale
Fewer services
Slower deploys, larger blast radius
Simpler ops
Decompose by capability
Requires domain expertise
Long-term stability
Decompose by tech layer
Easy initially
Becomes distributed monolith
Warning: Never decompose by technical tier (UI / API / DB). This guarantees a distributed monolith.