4
Most read
6
Most read
8
Most read
Hexagonal Architecture
Marcelo Cure
What is Hexagonal Architecture?
Architecture model created by Alistair Cockburn in 2005;
Port / Adapter concepts;
Architecture focused in isolation;
Domain/Core Business centralized;
Easy to test isolated components;
High level view
Adapter Anatomy
A port is usually an API;
An Adapter knows how to deal with external components;
Adapter Anatomy
We also can group adapters per port:
When should I use it?
If you need high level test coverage;
If you have the necessity to switch components, such as storage;
Long way evolutive applications;
If your application tend to go to microservices;
Need to communicate with manu external components;
Advantages
Isolation;
Testability;
Multiple implementations;
Less coupling;
No logic mixing;
Scalability, as far as I can scale the ports (in format of API);
Disadvantages
Many adapters tends to generate confusion;
Problems inherited from distributed architectures;
Should I have only 6 adapters?
It’s hexagonal, but not necessarily 6 sides/ports
References
http://alistair.cockburn.us/Hexagonal+architecture
Hexagonal Architecture

Hexagonal Architecture