HexaLayered Architecture

Agit Rubar Demir
2 min readOct 28, 2024

--

HexaLayered Architecture is an innovative architectural approach developed for Spring Boot applications, combining the advantages of Hexagonal (Ports and Adapters) and Layered architectures. This architecture aims to develop scalable and sustainable applications by combining modularity and simplicity.

Basic Principles

1. Modularity
Each module is independent in itself and isolated from other modules.

2. Layered Structure
The application is divided into layers with specific responsibilities.

3. Port and Adapter Distinction
Communication with external systems is provided through ports and adapters.

4. Domain Focused Design
Business logic is shaped around domain objects.

Architectural Layers

1. Controller Layer
HTTP meets requests and manages responses.

2. Service Layer
It contains business logic and performs operations on domain objects.

3. Port/Adapter Layer
It provides communication with external systems and transforms domain objects.

4. Repository Layer
Performs database operations.

Advantages

1. Flexibility
Interaction with external systems can be easily changed.

2. Testability
Each layer can be tested independently.

3. Ease of Maintenance
Simple, clean and organized construction facilitates long-term maintenance.

4. Scalability
The modular structure supports the growth of the application.

Projects Using HexaLayered Architecture

You can review the following open source projects to see real-world applications of HexaLayered Architecture:

Afet Yönetim Sistemi | AYS

HexaLayered Architecture is an example of an application that is best applied, complex and used in critical situations.

https://github.com/afet-yonetim-sistemi/ays-be

• Modular structure
• End-to-end error management
• Extended search and filtering features
• Extensive test infrastructure
• Advanced security and authorization features

Gelecek Bilimde

It is an example of an application that HexaLayered Architecture is best applied and used for content and user management.

https://github.com/gelecekbilimde/backend

• Modular structure
• End-to-end error management
• Extended search and filtering features
• Security and authorization features

These projects show how HexaLayered Architecture is applied in different usage scenarios. Since both projects are open source, you can examine their codes and see the practical applications of the architecture in detail.

Conclusion

HexaLayered Architecture offers a flexible, sustainable and understandable architectural solution for modern Spring Boot applications. Using this architecture, you can develop applications that are more modular, testable and easy to maintain.

You can use the README.md file in the repository for technical details of HexaLayered Architecture.

🚀 https://github.com/agitrubard/hexalayered-architecture

Contribution

We look forward to your contributions to developing and improving HexaLayered Architecture. You can share your ideas or suggestions you find on GitHub.

If you have developed a project using HexaLayered Architecture and would like to list it in README.md, please let me know!

--

--

Agit Rubar Demir
Agit Rubar Demir

Written by Agit Rubar Demir

Software Engineer at Finartz | Technical Mentor & Consultant, Project Management Consultant

Responses (1)