You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cdmdotnet edited this page Mar 20, 2016
·
3 revisions
Domain Modelling
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.
Commands and Events
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
To create a command
Create classes for each command in the Command package.
Apply the Command stereotype.
Add an Attribute names Amount and set the Type to System::double
To create an event
Create classes for each event in the Event package.