-
Notifications
You must be signed in to change notification settings - Fork 80
Tutorial 4: Defining Business Logic Workflows as Domain Models :: Commands and Events
cdmdotnet edited this page Mar 20, 2016
·
3 revisions
Domain modelling here is the process of taking a workflow diagram and defining attributes that tell Visual Studio the intent of objects and data like properties and data types.
Since commands
and events
are the core of any CQRS system, it's best to start with these two types of objects.
Referring back to our diagram from step 2, we have two commands
and four events
:
- Commands
- WithdrawFundsFromAtm
- WithdrawFundsFromAccount
- Events
- WithdrawFailedDueAmountLessThanZero
- WithdrawValidated
- WithdrawFailedDueInsufficientFunds
- WithdrawFundsFromAccountSucceeded
- Create classes for each command in the
Command
package. - Apply the
Command
stereotype. - Add an
Attribute
namesAmount
and set the Type toSystem::double
- Create classes for each event in the
Event
package. - Apply the
Event
stereotype.