Hexagonal service (ports and adapters)
c4v1/01 Views
/02 About
A service whose domain core depends only on ports; adapters for HTTP, messaging and persistence plug in at the edges.
The business logic sits at the centre and talks to the outside world only through ports it defines. Adapters translate between those ports and real technologies, so the core can be tested on its own and technologies can change without touching it. When to use: services with meaningful business rules, a long expected life, several ways in (API, events, batch) or a database that may change. Trade-offs: a testable, technology-independent core at the cost of more interfaces and mapping code. Keep it light for thin CRUD services.
Published by Lattix · 9 elements · 9 relationships · validated on publish
/03 Contents
- Application Component
- Application core, Domain model, HTTP adapter, Messaging adapter, Persistence adapter
- Interface/Endpoint
- Inbound port, Outbound port
- Data Store
- Service database
- Business Actor
- Caller