hexagonal architecture

11
Hexagonal Architecture Marcelo Cure

Upload: marcelo-cure

Post on 09-Feb-2017

516 views

Category:

Software


19 download

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