Skip to content

Commit 1f80755

Browse files
author
Alexander Litus
committed
Add docs to aggregate.
1 parent 747a18e commit 1f80755

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/src/main/java/org/spine3/server/aggregate/Aggregate.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.spine3.server.aggregate.error.MissingEventApplierException;
3737
import org.spine3.server.command.CommandHandler;
3838
import org.spine3.server.entity.Entity;
39+
import org.spine3.server.event.EventBus;
3940
import org.spine3.server.reflect.Classes;
4041
import org.spine3.server.reflect.CommandHandlerMethod;
4142
import org.spine3.server.reflect.MethodRegistry;
@@ -60,6 +61,7 @@
6061
* These events are used later to restore the state of the aggregate.
6162
*
6263
* <h2>Creating aggregate class</h2>
64+
*
6365
* <p>In order to create a new aggregate class you need to:
6466
* <ol>
6567
* <li>Select a type for identifiers of the aggregates. If you select to use a typed identifier
@@ -70,9 +72,13 @@
7072
* </ol>
7173
*
7274
* <h2>Adding command handler methods</h2>
75+
*
7376
* <p>Command handling methods of an aggregate are defined in the same way as described in {@link CommandHandler}.
7477
*
78+
* <p>Event(s) returned by command handler methods are posted to the {@link EventBus} automatically.
79+
*
7580
* <h2>Adding event applier methods</h2>
81+
*
7682
* <p>Aggregate data is stored as sequence of events it produces. The state of the aggregate
7783
* is restored by re-playing the history of events and invoking corresponding <em>event applier methods</em>.
7884
*

0 commit comments

Comments
 (0)