Skip to content

digli-dg/hexagonal-architecture-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexagonal vs Layered Architecture

Quickstart

  • Linux/MacOS:

      ./mvnw spring-boot:run
    
  • Windows:

       mvnw.cmd spring-boot:run
    

Educational Repository

This is a purely educational repository, designed to illustrate the difference between hexagonal and layered architectures.

Basically, it consists of:

  • layered folder: Implementation of a classic Spring Boot layered architecture. Exposed endpoint of type /layer/products/:id
  • hexagonal folder: 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.

Duplicated Components, Independent Projects

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.

Available Endpoints

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.

Tests

The test folder includes a suite of unit tests and an acceptance test.

About

Educational repository, designed to illustrate the difference between hexagonal and microservice architectures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages