DEV Community

Cover image for Hexagonal Architecture

Hexagonal Architecture

Abhinav Pandey on November 01, 2021

In the evolution of software architecture, loose coupling has been at the centre. There is an emphasis on breaking applications into components whi...
Collapse
 
nk__3dd9dba1ea554cb02886a profile image
NK

Great article on separation of building units. I hope the name hexagonal architecture doesn’t catch on because it is misleading and the shape doesn’t actually have anything to do with the architecture. As you mention, the architecture can be redrawn as any polygon.

Collapse
 
abh1navv profile image
Abhinav Pandey

Apparently it has...this was introduced around 2005...ports and adapters pattern was the intended name but now everyone calls it hexagonal. Consider the name as something to remember it by.

Glad you liked the article. 😊

Collapse
 
lyqht profile image
Estee Tey

great article, thanks for writing this! I really like that you split into the 3 sections - UI, business logic & backing services, and then demonstrated to the reader that with the adapter having a specified interface, one could easily swap the service behind the port and still have a functional integrated system.

Collapse
 
abh1navv profile image
Abhinav Pandey

Thanks Estee! Glad you liked it 😊

Collapse
 
aschwin profile image
Aschwin Wesselius

This approach is similar to the Onion Architecture or the Clean Architecture (by Robert Martin). There are similarities but some insights differ a bit, so suggest to study them too.

Further I suggest to think about decomposition by change (volatility) rather than function. Loose coupling has its advantages but it can become confusing to what extent the decoupling should occur. The volatility of the element can guide in making decisions on these things. Thats why β€œThe Method” by IDesign is gaining traction nowadays amongst architects. You can read more about it in the book β€œRighting Software” by Juval LΓΆwy.

Collapse
 
heldanate profile image
HeldaNate

How should I change the persistence layer ? revenge spells that work

Collapse
 
astrojets profile image
astro-jets

Nice article I learnt a thing from this. Keep it up πŸ‘

Collapse
 
abh1navv profile image
Abhinav Pandey

Thank you!

Collapse
 
mcsee profile image
Maxi Contieri

great article!
low coupling!

Collapse
 
abh1navv profile image
Abhinav Pandey

Glad you like it 😊

Collapse
 
rodrigobsimon profile image
Rodrigo Simon

Nice article!

Collapse
 
abh1navv profile image
Abhinav Pandey

Thanks!!

Collapse
 
lucasargate profile image
Lucas Argate

Wow! Really nice content! I will follow more about that! Thanks so much!

Collapse
 
abh1navv profile image
Abhinav Pandey

Thanks for your kind words 😊