Hexagonal Architecture vs. Clean Architecture

6,536 views
Skip to first unread message

Dave Schinkel

unread,
Aug 19, 2015, 11:55:14 PM8/19/15
to Clean Code Discussion
I'm building out a new REST API.  It's purpose is to serve data to various clients.  I'm trying to keep it generic so that it can be reused regardless of application as much as possible and trying to abstract out the Entity logic and Interactor logic out somehow and keep that decoupled from the basic Data API I'm building here.

With that I've been looking at Uncle Bob's Episode 7 video as well as brushing up on Hexagonal architecture (ports and adapters).

Question:  Is a Hexagonal Architecture related in any way to Clean Architecture?  In other words, in a Hexogonal Architecture, we have ports and adapters and then inside the hexagon, the application architecture.  In Clean Architecture, we have Boundary Objects, Interactor Objects, Entity Objects (and probably lower level Repository Objects that talk to Data Layer CRUD objects).  So do they cross paths?  Such as I guess Clean Architecture in a Hexagonal model would be the application logic?  Or maybe not?  Do these two styles even cross paths or relate to each other at all?  Do ports and adapters equate to Clean ARchitecture ideas such as boundary objects to any degree?

Israel Fonseca

unread,
Aug 20, 2015, 8:06:25 AM8/20/15
to Clean Code Discussion
From my understanding they are conceptually equal, just with different names.

Uncle Bob even compare it with other architectures here:


--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.

Guido Dechamps

unread,
Aug 20, 2015, 9:04:52 AM8/20/15
to Clean Code Discussion
yes they are the same.
Important is wat lies central (the domain, not the db :)) and that inner layers do not depend on outer layers.

Dave Schinkel

unread,
Aug 20, 2015, 11:09:02 AM8/20/15
to Clean Code Discussion
Thanks I totally forgot about that post and diagram.  I need to keep that surfaced in my list of favorites more.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.

Dave Schinkel

unread,
Aug 20, 2015, 11:09:24 AM8/20/15
to Clean Code Discussion
Thanks Guido, good summary.
Reply all
Reply to author
Forward
0 new messages