HEXAGONAL ARCHITECTURE
PORTS AND ADAPTERS
1
INTRODUCTION
WHAT IS IT?
• It’s a software building pattern
• Preaches that your business
domain should not care about
anything that’s not part of
business rules
• Everything that needs input
from the “outside” world is
exposed as a port
• The outside world adapt this
port to it’s implementation
2
HEXAGONAL ARCHITECTURE
A VIEW
• At the center of our architecture
we have our Domain model
Our domain model contains
our business rules, models
and domain services
• Everything that need interaction
with the outside world is
exposed as a “Port”
The port defines one action
that should be done by an
external adapter, eg:
“ClassifyDocument”,
“UploadFileToDrm”
We have input and output
ports
3
HEXAGONAL ARCHITECTURE
H.A + DDD = S2
• Hexagonal Architecture and
Domain Driven Design are
made for each other
• Isolate your domain, build upon
it
• Strive for agnostic technologies
4
HEXAGONAL ARCHITECTURE
RECOMMENDED READING
• Domain Driven Design Book – Eric Evans
• Hexagonal Architecture – Alistair Cockburn
5
HEXAGONAL ARCHITECTURE
HANDS ON