This project is a sample production-ready implementation for demonstrating the power of Hexagonal Architecture (aka Ports And Adapters Pattern) written in Java.
We want to write clean, maintainable, well-defined boundary context, well-tested domain code and isolate business logic from outside concern.
The hexagonal architecture was invented by Alistair Cockburn in an attempt to avoid known structural pitfalls in object-oriented software design, such as undesired dependencies between layers and contamination of user interface code with business logic, and published in 2005.
A timeless goal of software engineering has been to separate code that changes frequently from code that is stable.
~ James Coplien / Lean Architecture
We recommend Hexagonal Architecture for those who want to write clean, maintainable, well-defined boundary context, well-tested domain, and decoupling business logic from technical code.
You can use any programming language for implementing Hexagonal Architecture. Here is the list of technologies we used for the demo application;
It's so easy to reach 100% code coverage if you design by tests wisely via TDD. There are the types of tests written:
This repository is a side project developed while preparing the conference talk "Growing Hexagonal Microservices With TDD" at Java Day Istanbul 2020. As the authors of this repository, we've been using hexagonal architecture in all microservices (i.e. more than 50+ microservices) running in production since 2017. We believe modularity is the key to building maintainable and high-quality software. That's why we shared our demo project with the community to attract their interest in the topic.
Please feel free to open tickets to suggest new features and improvement points. Please feel free to contribute.
Please take a look at code of conduct before opening issues or creating pull requests.
Distributed under the MIT License. See LICENSE for more information.
$ claude mcp add Modular-Architecture-Hexagonal-Demo-Project \
-- python -m otcore.mcp_server <graph>