DEV Community

Cover image for Modern clean architecture
Bertil Muth
Bertil Muth

Posted on • Updated on

Modern clean architecture

I am pleased to announce the release of the modern-clean-architecture project.

Clean architecture follows these principles:

  • The domain code and use cases of an application are independent of frameworks, UI, the database or any external agency, e.g. external services.
  • Through this clear separation of concern, the domain code and use cases become testable independent of the framework, UI or infrastructure.
  • The user interface, database technology, external services and framework specific code can change without affecting the domain code and vice versa.

Modern clean architecture provides a fresh view on clean architecture, in a Spring Boot environment. It reduces the effort required to create a clean architecture through the following constraints:

  • Serialization of immutable requests and responses without serialization specific annotations.
  • No necessity for DTOs. You can use the same immutable value 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.

Visit the website, I'm happy to hear your thoughts.

Top comments (0)