You should already understand what domain events are, why they are important, and how to find and code them. Now, we will look into other uses for events. Hopefully, after reading this chapter, it will be clear why we need to use events to update the aggregate state. Before, we only used events inside our aggregates, and it might look a bit like overkill to raise those events and do the state transition separately, in the When method.
This time, you will learn how events can be used to persist the state of an object, instead of using traditional persistence mechanisms, such as SQL or a document database. That is not an easy thing to grasp, but the reward is satisfying. Using events to represent the system behavior and derive its state for any given moment in time has many advantages. Of course, silver bullets do not exist, and before deciding whether Event Sourcing...