This example shows the Dog
class used in the tutorial and module docs.
It uses the Aggregate
class and the @event
decorator from the library to define events that are derived from command method signatures. The bodies of the command methods are used to apply the events to the aggregate state.
The application class simply uses the aggregate class as if it were a normal Python object class.
../../../eventsourcing/examples/aggregate1/domainmodel.py
../../../eventsourcing/examples/aggregate1/application.py
../../../eventsourcing/examples/aggregate1/test_application.py