Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 818 Bytes

aggregate1.rst

File metadata and controls

33 lines (19 loc) · 818 Bytes

Aggregate 1 - Declarative syntax

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.

Domain model

../../../eventsourcing/examples/aggregate1/domainmodel.py

Application

../../../eventsourcing/examples/aggregate1/application.py

Test case

../../../eventsourcing/examples/aggregate1/test_application.py