Spring boot application with domain driven design example.

Layers

Interfaces

How you can deliver your software.
e.g.: Rest Controllers, Raw Servlets, Swing Views.
Implementation example: PaymentController

Application

Where your use cases are orchestrated and the transactional scopes are managed.
e.g.: Payment process.
Implementation example: PaymentProcessManager (Interface) / PaymentProcessManagerImpl (protected Impl)

Domain

Where your business rules are handled.
e.g.: Payment process: (request payment, authorize payment, confirm payment, cancel payment, etc).
Implementation example: Payment (AggregateRoot)

Infrastructure

This layer acts as a supporting library for all the other layers.
e.g.: SQL Tables representation, SQL Repositories implementation, i18n, serialization, validators, etc.
Implementation example: