I am trying to omit DDDD in the style of Greg Jung .
There is a lot of talk about how to implement DDDD with CQRS + EventSourcing and there are some implementation examples ... and in general this can be quite confusing ...
In the Gregs view, aggregates do not have getters or setters - just state-changing methods that emit the corresponding event.
Basically, an event describes state transitions that occurred in the past. This data describes what has changed.
Some say that this data can be "enriched" with additional data .
Where can this additional data come from ?
i.e. I have User and Usergroup as aggregate roots (they can exist independently, have an identity). User has a method called AddToUsergroup .
public class User : AggregateRoot {
If I would like to enrich an " event with the name of a user group (for debugging reasons or something like this), how would I do it?
- getters nonexistent
- user group internal state unavailable
Injection : repositories in User not allowed ( Am I right here?!? >), E.g.
- Read Side Repository
- Event Repository
Questions at the bottom:
Can Should something like repositories be introduced to combine the roots?- If the event only uses the data available through the parameters and the internal state of the population?
- Should events only contain minimal data describing a state change?
And (a little off topic, but the sample is here)
- Should
AddToUsergroup take Guid instead of the full root placeholder ?
Looking forward to your answers!
Lg
warappa
David Rettenbacher
source share