Contents
What is event aggregate?
Global event aggregates An event aggregate is a calculation of the number of (count) of an event across all instances of an event type, or a selected subset of the instances of an event type. Similar to entity aggregates, an event aggregate can also apply to the values of the properties of events.
What is a command in event storming?
The Command represents a decision made by a user in response to some information retrieved from the Read Model . The Actor is the person who issues the Command and the System is the thing that receives the Command . It is the responsibility of the System to respond to the Command and therefore trigger an Event .
What are projections in event sourcing?
By definition, a projection is a representation of an object using a different perspective. For example, isometric and orthographic projections allow us to represent a 3D object on paper using different points of view.
What’s the purpose of event storming?
Pioneered by Alberto Brandolini, “event storming” is a kind of brainstorming workshop to map out the events within a domain of software development. It’s a workshop-based technique to bring clarity to complex web projects in the context of domain-driven design (DDD).
How are domain events handled in order aggregate?
When the user initiates an order, the Order Aggregate sends an OrderStarted domain event. The OrderStarted domain event is handled by the Buyer Aggregate to create a Buyer object in the ordering microservice, based on the original user info from the identity microservice (with information provided in the CreateOrder command).
How does aggregate root get list of events?
The external service retrieves the list of previous events. Given the aggregate is an entity it is a trivial ‘get by id’ or ‘SELECT * FROM X WHERE ID = …’ database query. The outside service would then pass in the events to the LoadFromHistory method which in turn would apply each event to it’s self.
Where are the changes stored in aggregate root?
Once an aggregate has completed a command (more on this further down) it will store up the changes in the _changes list. These changes are in the form of an Event or description of what has just happened. On completion of the command, the outside system would then request any uncommitted changes. That list would then saved.
What is markchangesascommitted method used in aggregate root?
On success the MarkChangesAsCommitted method used and the state transition is complete. This is a two phase process. On receipt of a command, the first task of the aggregate is to ensure it can run the command. In our holiday example above, we would do two things to ensure the invariant remained true.