Create services with a clean architecture with significantly less effort necessary than usual.
The main idea of Clean Architecture: Domain code and use cases are independent of frameworks, UI, the database and external services.
So building an application in a Clean Architecture style has a positive effect on maintainability:
- You can test domain code and use cases without the framework, UI and infrastructure.
- Technology decisions can change without affecting the domain code. And vice versa. It is even possible to switch to a new framework with limited effort.
Modern clean architecture reduces the effort to create a clean architecture through the following features:
- Serialization of immutable requests and responses without serialization specific annotations.
- No necessity for DTOs. You can use the same immutable objects for requests/responses in web layer and use cases.
- Generic endpoint that receives and forwards POST requests. New behavior and domain logic can be added and used without the need to write framework specific code.
- Testing with a repository double that acts like a normal repository. No need for mocking it.
To start creating a modern clean architecture, visit the spring-behavior-web page.
For testing support, see the spring-behavior-test page.
For a working sample from frontend to backend, see the To Do List sample.
If you have any questions, see the Questions & Answers on the wiki. Or chat with me on Gitter.