Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bpstelios10/clean-architecture-sample

Clean architecture example, implemented with spring web
https://github.com/bpstelios10/clean-architecture-sample

clean-architecture docker docker-compose gradle h2-database java junit5 lombok mockito postgres spring-boot spring-profiles

Last synced: about 12 hours ago
JSON representation

Clean architecture example, implemented with spring web

Awesome Lists containing this project

README

        

# SPRING WEB WITH CLEAN ARCHITECTURE

COMMIT BY COMMIT IMPLEMENTATION OF A SPRING WEB APP THAT IMPLEMENTS CLEAN ARCHITECTURE

The main focus is to separate business entity, use cases and infrastructure (gateways, controllers, repositories etc)
into 3 different levels.
In our case the 3 levels will be the 3 different packages: domain, usecases, adapter.

After we separate the 3 layers, we need to use interfaces for any interactions between layers.
Also, keep dependencies pointing from outer layer to inner and avoid having dependencies between layers that are not
next to each other (usually an exception is a repository which will point to business entities).

So our example should look like this:

class diagram

Notes: for technical documentation/guides have a look [here](docs-resources/TECH-DOC.md)