Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 1.03 KB

aggregate6.rst

File metadata and controls

37 lines (22 loc) · 1.03 KB

Aggregate 6 - Functional style

This example shows another variation of the Dog aggregate class used in the tutorial and module docs.

Like in the previous example, this example defines immutable Aggregate and DomainEvent base classes, as frozen dataclasses. However, this time the aggregate class has no methods. All the functionality has been implemented as module-level functions.

Like in the previous examples, the application code in this example must receive the domain events that are returned from the aggregate command methods. The aggregate projector function must also be supplied when getting an aggregate from the repository and when taking snapshots.

Domain model

../../../eventsourcing/examples/aggregate6/domainmodel.py

Application

../../../eventsourcing/examples/aggregate6/application.py

Test case

../../../eventsourcing/examples/aggregate6/test_application.py