-
Linux/MacOS:
./mvnw spring-boot:run -
Windows:
mvnw.cmd spring-boot:run
This is a purely educational repository, designed to illustrate the difference between hexagonal and layered architectures.
Basically, it consists of:
layeredfolder: Implementation of a classic Spring Boot layered architecture. Exposed endpoint of type/layer/products/:idhexagonalfolder: Implementation of a hexagonal architecture. Exposed endpoint of type/hexagonal/products/:id
Each one functions as an independent endpoint and architecture. They have been grouped into the same project to facilitate comparison, but either one could be removed and the project would still function.
Some objects and components have been duplicated in both the hexagonal and layered folders (for example, ProductEntity.java) so that each project remains independent and the expected folder structure is not altered in each architecture (i.e., ProductEntity.java is located in the expected folder in the hexagonal architecture, and the same applies to the layered architecture).
Only some utility objects (and the input DTO) have been extracted/shared in the common folder.
You can find the available endpoints in the /http-requests/products.http folder. They are formatted so that calls can be triggered directly from IntelliJ.
The test folder includes a suite of unit tests and an acceptance test.