Hexagonal Architecture – Ivan Paulovich

Hexagonal Architecture – Ivan Paulovich


Its inside the Application Layer that we develop
the uses cases, these objects interact with the Domain layer and the application services. The use cases are called ports and are exposed
to outer layers as simple interfaces. Its inside the infrastructure layer that we
build the adapters to the application services. For example, on the right side we could develop
a repository to a SQL Database and its fake implementation that loop back to an inmemory
repository. Here another adapter example, imagine that
we plan to consume a Web Service. We could create a simple fake implementation
then in the future implement the proper HTTP adapter. Now, take a look on the left side. Here we implement the driving adapters. These components initiates the conversation,
for instance a web interface or the test suit that calls the uses cases. Let’s do a quick review. I showed that for every service that the Application
Layer requires we created an adapter along with its fake implementation. The benefit of Hexagonal Architecture is that
we can develop a lot of the software without worrying about the adapter internal details,
we just fake them as long as possible. The Hexagonal Architecture requires knowleadge
of interfaces, dependency inversion and the adapter pattern. Do you wanna know more about modern architectures? Follow @ivanpaulovich on GitHub / Subscribe
on youtube.

Leave a Reply