An event sourced aggregate
Last week I shared my theoretical understanding of event sourcing. Today, I want to make an attempt at making that theory tangible by implementing an event sourced aggregate. In traditional systems, we only persist the current state of an object. In event sourced systems, we don’t persist the current state of an object, but the sequence of events that caused the object to be in the current state. If we want an aggregate to be event sourced, it should be able to rebuild itself from a stream of events, and it should be able to record all the events it raises. ...