forked from JoergEg/CQRS-Sample
-
Notifications
You must be signed in to change notification settings - Fork 55
Eventual Consistency with and UIs
haf edited this page Jul 22, 2011
·
2 revisions
#Eventual Consistency with and UIs
When building Task Driven UIs with commands and events, it's good to consider what the user expects from the GUI. With the default model, we have two times, Tserver and Tclient:
After sending the command it takes some time for the underlying domain model to respond to that command and produce the events that reflect the change of the model. The ThinReadLayer
is eventually consistent and the event handler denormalizes the events from the message bus into a form which is suitable for the chosen GUI.
There are a few different ways of showing the outcome of the command that takes a couple of seconds to execute:
- If the command might or might not succeed, display a waiting page, or a page asking the user for his/her next move.
- Educate your users about the 'time it takes for the computer to think'
- If the command is likely to succeed, just display the outcome of it directly in the view model of your application.
- Build your GUI to be reactive - (TODO for Documently) - such that events directly update the GUI as they come in - ObservableCollection + Event Listener for WPF, or use something like TaskUI or Comet with a skilled web server.