1. Overview
In this quick article, we'll discuss Hexagonal Architecture in Java through a practical example.
2. What is Hexagonal Architecture?
...
For further actions, you may consider blocking this person and/or reporting abuse
There seems to be a gap between
EmployeeService
andEmployeeDBPort
. PresumablyEmployeeService
would invokeEmployeeDBPort
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.
Good point. We can do that too.