Let's now explain how to use the framework by building a sample bank account application. This tutorial will walk you step-by-step through the definition of the main classes and the implementation of the required components.
To develop an application using the framework, you need to define three main types of classes:
- Model: Represents the core data structure of your application.
- Event: Represents mutations to the model.
- ModelSpace (Aggregation): Manages the lifecycle and state of models, including snapshots and event replay.
In the bank account application, we will define the following classes:
- Model:
HtBankAccountrepresents the bank account model. - Event:
HtBankAccountBalanceChangedrepresents changes to the bank account balance. - ModelSpace:
HtBankAccountSpacemanages multiple bank accounts and their lifecycles.