Im trying to write my first CQRS application and I’m having trouble making a simple view involving a grid that is bound to a collection of T (an aggregate root.)
I’ve done extensive googling and I can’t find any ideas on modeling a user experience for this list, using CQRS.
1) One idea is to have a command for Creating, Editing, and Removing each T from the list, and use a custom implementation of a BindingList to know when these actions have occured.
2) Another option is to wait for the user to make all changes necessary, and somehow analyze the differences between the original aggregate root and the edited, and send a series of commands for these changes all at once.
My problem with number one is that I’m using Identity columns instead of Guids (so the client is NOT generating an Id for a new T) so if the user decides to delete a model they just created, before the client’s create command is processed on the server, how can I tell the server what model to delete?
Number two seems very complicated because I would have to figure out how to assess added, deleted, and edited items in order to send the batch of commands.
Thoughts?
There is no reason to model CRUD (Create, Read, Update, Delete) operations with CQRS. Not even in a pet project or for practice purposes.. If it’s CRUD then handle it the simplest way possible.
Features like user management, master data entry etc. very often belong to their own Bounded Context that shouldn’t use CQRS.