compile time vs runtime views.
When thinking about the hexagonal architecture, it is important to make a clear distinction between the compile-time, and runtime views of the software. The layered architecture looks similar at compile time and runtime. In both cases, the ui depends upon the network, which depends on the business layer, which depends upon the data access layer.
The hexagonal architecture looks similar to the layered design at runtime. But at compile time it looks very different, you have something like this. Please forgive the bad ascii art. If I get some readers I’ll take the time to make some images and figure out how to upload them
Compile Time
UI
|
\/
NL-->BL< --DAL
Runtime
UI<-->NL< -->DAL
At compile time, you have business logic, and you have external “transforms” that work with that logic in order to comunicate with real-world external situations like the the ui, network, and database. At runtime you have a rather conventional layered design. The ui talks to the network, which talks to the data access component.
It is the compile time view that makes all the difference in implementing this design.