For the record, this demo is kind of copied from the quickstart but it is in some ways more elaborate and using the latest and greatest version 2.0.7
Now we start thinking about the behaviour of our little demo application. A user can create a new todo item and he can mark an existing item as completed.
When commands are issued, something is bound to happen, so we also need to think about what events occur.
We also need to think about our aggregate, in this case our ToDoItem
Of course we need to test if events are properly created when a command is issued.
We also need to configure the application, as usual we will use Spring to wire our app.
The demo app just issues 2 commands, mimicking what a user might do. And to make it interesting we also create an event handler for our ToDoItem events.
When we run the ToDoApplication we notice a file gets created in c:/tmp/axondemo/ for our aggregate called
TODO-1.events. Also we nicely see some output appearing in the console:
We've got something to do: Clean house (TODO-1) We've completed a task: TODO-1
No comments:
Post a Comment