Alistair Cockburn introduced a Hexagonal architecture, now it is called Ports and Adapters pattern. In my understanding, the concept is similar to n-layer architecture where one layer depends on the other layer via abstraction (interface) only. For example, the application layer depends on the many repository services interfaces rather it's implementation. There is no need of a separate implementation of a ports or adapters here. An IoC container like Unity can inject the implementation of the repositories, so adapters are not necessary.
Am I confusing this ports and adapters pattern with DIP (Dependency Injection Principle)?
Can someone point me to an implementation of the ports and adapters pattern? Thanks.
The hexagonal architecture, or ports and adapters architecture, is an architectural pattern used in software design. It aims at creating loosely coupled application components that can be easily connected to their software environment by means of ports and adapters.
Hexagonal Architecture and many other architectural patterns share the same goal: the separation of concerns. And they all achieve this goal by dividing the application into layers. And the Clean Architecture is just an attempt at integrating all these architectures into a single idea.
The hexagon allows radial organization as well as flat surfaces. A honeycomb-like grid can also be built upon or broken down into a triangular grid, while a hexagonal shape also lends itself to a larger number of external surfaces.
Hexagonal architecture is a pattern that uses the mechanism of ports and adapters to achieve separation of concerns and isolate external systems and other external code such as user interfaces and databases from the core application.
I was looking for this myself.
Alistair Cockburn has an example with an explanation that might help you out and there was an example was given at this conference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With