This repository holds a example of a service implementing DDD and CQRS, and is used to get a glimpse into DDD with CQRS. This example is based on use cases I experienced working on projects in the public austrian social insurance.
We will talk about the use of DDD and the process necessary when designing a DDD based application.
-
How important is ubiquitous language?
-
Where to handle state changes?
-
To recognize business is important not technology
We will discuss the DDD models which are already implement, their usage and why they have been implemented as they are.
-
What is an aggregate root
-
What is a value model
-
State change handling within domain models
We will discuss domain events, why we need them, how to implement them, and how to notify registered observers within an Jakarta EE environment.
-
What is a domain event for
-
Why using domain events
-
What data is necessary within a domain event
We will discuss the hexagonal architecture and how it play with DDD.
-
What is the architecture for
-
How to realize such an architecture in an application
-
What are the advantages of the hexagonal architecture
We will discuss the segregation of commands and queries and use-cases.
-
What is CQRS for
-
why segregating commands and queries
-
what are use cases for
-
Cannot be created if
-
one already exists with the
Nummer
-
one already exists for an
VSNR
in stateNEW
.
-
If one of the rules is broken, then the execution must fail with an exception.
-
Can only be marked
STORNIERT
, when marked as-
NEW
-
ANWEISUNG_FREIGEGEBEN
-
-
Can only be marked
ANWEISUNG_FREIGEGEBEN
, when marked as-
NEW
-
-
Can only be marked
ANGEWIESEN
, when marked as-
ANWEISUNG_FREIGEGEBEN
-
-
Can only be marked
ABGELEHNT
with an explanation (at least 50 characters) and when marked as-
NEW
-
ANWEISUNG_FREIGEGEBEN
-
-
Must have set
angeiwesenAm
when marked asANGEWIESEN
If one of the rules is broken, then state transition must not take place and the execution must fail with an error.
-
Can only have
5
Einzelleistungen -
Max sum netto is
100.00
-
Max sum brutto is
120.00
If one of the rules is broken, then the Einzelleistung must not be added but ignored.