Skip to content

Commit 954cac8

Browse files
committed
Improved aggregate example 5.
1 parent ebd07ba commit 954cac8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/topics/examples/aggregate5.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ construct a snapshot object from an aggregate object.
4141
Domain model
4242
------------
4343

44-
The :class:`~examples.aggregate5.domainmodel.Dog` aggregate is defined as immutable frozen data class that extends
45-
the aggregate base class. Event classes are explicitly defined and explicitly triggered in command methods.
46-
47-
It defines a :func:`~examples.aggregate5.domainmodel.Dog.mutate` method, which
48-
evolves aggregate state by constructing a new instance of the aggregate class each time it is called,
49-
according to the type of event it is called with.
44+
The :class:`~examples.aggregate5.domainmodel.Dog` aggregate class is defined as immutable frozen data class
45+
that extends the aggregate base class. The aggregate event classes, :class:`~examples.aggregate5.domainmodel.Dog.Registered` and
46+
:class:`~examples.aggregate5.domainmodel.Dog.TrickAdded`, are explicitly defined.
47+
48+
The :class:`~examples.aggregate5.domainmodel.Dog` aggregate class defines a
49+
:func:`~examples.aggregate5.domainmodel.Dog.mutate` method, which evolves aggregate state by constructing a new
50+
instance of the aggregate class each time it is called, according to the type of event it is called with. Support
51+
for reconstructing an aggregate object from an aggregate snapshot object is included in this method.
5052

5153
.. literalinclude:: ../../../examples/aggregate5/domainmodel.py
5254
:pyobject: Dog

0 commit comments

Comments
 (0)