Top Banner
Hexagonal Architecture Marcelo Cure
11

Hexagonal Architecture

Feb 09, 2017

Download

Software

Marcelo Cure
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Hexagonal Architecture

Hexagonal Architecture

Marcelo Cure

Page 2: Hexagonal Architecture

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;

Page 3: Hexagonal Architecture

High level view

Page 4: Hexagonal Architecture

Adapter Anatomy

A port is usually an API;

An Adapter knows how to deal with external components;

Page 5: Hexagonal Architecture

Adapter AnatomyWe also can group adapters per port:

Page 6: Hexagonal Architecture

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;

Page 7: Hexagonal Architecture

AdvantagesIsolation;

Testability;

Multiple implementations;

Less coupling;

No logic mixing;

Scalability, as far as I can scale the ports (in format of API);

Page 8: Hexagonal Architecture

DisadvantagesMany adapters tends to generate confusion;

Problems inherited from distributed architectures;

Page 9: Hexagonal Architecture

Should I have only 6 adapters?It’s hexagonal, but not necessarily 6 sides/ports

Page 10: Hexagonal Architecture

Referenceshttp://alistair.cockburn.us/Hexagonal+architecture

Page 11: Hexagonal Architecture