Javarevisited

A humble place to learn Java and Programming better.

Member-only story

Hands-on Hexagonal Architecture With Spring Boot

--

Photo by Mitchell Luo on Unsplash

Hexagonal architecture, or port and adapter architecture, is an architectural pattern used in software design. It aims to create systems based on application components that are loosely coupled and can be easily connected to their software environment through ports and adapters. These components are modular and interchangeable, which enhances processing consistency and facilitates test automation.

In this article, we will first explain the hexagonal architecture in more detail, then will create a spring boot application based on this architecture 😀.

Hexagonal architecture

The hexagonal architecture was created by Alistair Cockburn. It allows an application to be equally driven by users, programs, automated tests, or batch scripts, and to be developed and tested in isolation from its possible execution devices and databases.

The principle of the hexagonal architecture is to isolate the domain from any dependency, even a framework dependency.

This allows you to reuse the business domain independently of the change of the technical stack. It will also increase the testability of your domain since you no longer mix it with integration issues.

--

--

Javarevisited
Javarevisited

Published in Javarevisited

A humble place to learn Java and Programming better.

Sofiene Ben Khemis
Sofiene Ben Khemis

Written by Sofiene Ben Khemis

Software Engineer & AWS Community Builder I’m not perfect. still running after my dreams. going to the moon 🌑

Responses (8)