re: Hexagonal Architecture in Java VIEW POST


There seems to be a gap between EmployeeService and EmployeeDBPort. Presumably EmployeeService would invoke EmployeeDBPort to communicate with the database?


In this case EmployeeService is actually EmployeeServiceAdapter that communicates with the database.
I've named the EmployeeService as the EmployeeServiceAdapter, to let reader know that it act as an Adapter.
Thanks for pointing it out. I'll mention in the article.


Well, now this call chain looks just like a classic three-layer architecture. In particular the call from the controller to the DBPort (actually an implementation of the DBPort) feels somewhat "inside out". If you look at the stereotypical HA diagram, it gives the impression that all ports are external facing.

Perhaps a follow-up expanding on the differences between HA and the classical layered architecture?

Yes, it looks like a classic three-layer architecture. However, the pattern doesn't talk about the layers. Rather, it talks about ports and adapters.
HA expose interface to consume the inside component through a port and adapter is the middleware software component to interact with a port. Adapter can be in multiple technologies.

Thanks for suggesting a follow up on the comparison between HA and classical layered architecture.

code of conduct - report abuse