Software Architecture – Hexagonal Architecture Pattern

software_architecture_patterns

                     In this article, we will see “Hexagonal Architectural Pattern” also known as “Ports and Adapters” pattern. As developers so far we have created applications with tiered architecture styles like MVC (Model View Controller). With these architectural styles, up to a certain extent, we were able to decouple the domain logic with other functionalities. At times the domain logic uses to leak into UI or other functionalities. As the core logic is getting leaked into other layers, the impact of the code change will have a ripple effect on other modules. To avoid this we can go with “Ports and Adapters” architecture style.

                      The “Ports and Adapters” style will have domain logic as Core and the Adapters will have the application logic specific to translate an interface from the outside request into a compatible one. The core and the adapters sit as the inner layer. The ports sit on the outer layer to interact with the external services. The below diagram depicts the above said architectural style.

hexagonal-architecture

                        The advantages of this style are the core logic abstracted from the outside world. The code is decoupled via the adapters. We can add or remove the new functionalities easily. We can perform testing of core logic and the adapters in isolation mode.

                      In the coming article, we will see what is microservices architectural style? and what are the driving factors behind it? Till then Stay Tune!!!

Advertisement

Siva Janapati is an Architect with experience in building Cloud Native Microservices architectures, Reactive Systems, Large scale distributed systems, and Serverless Systems. Siva has hands-on in architecture, design, and implementation of scalable systems using Cloud, Java, Go lang, Apache Kafka, Apache Solr, Spring, Spring Boot, Lightbend reactive tech stack, APIGEE edge & on-premise and other open-source, proprietary technologies. Expertise working with and building RESTful, GraphQL APIs. He has successfully delivered multiple applications in retail, telco, and financial services domains. He manages the GitHub(https://github.com/2013techsmarts) where he put the source code of his work related to his blog posts.

Tagged with: ,
Posted in Design Patterns

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Dzone.com
DZone

DZone MVB

Java Code Geeks
Java Code Geeks
OpenSourceForYou
%d bloggers like this: