Occasionally connected CQRS systems - Client and Server Commands - Task based screens

最后都变了- 提交于 2019-12-06 06:19:06

The way I understand it, the tasks, generally speaking, should line up with Commands or Functions waiting on the Server.

Or sometimes events, but the basic idea is right.

Surely the User will not go from [first name] => to [last name] => to [address] => to [email], etc. -- in a wizard like style, where each wizard screen maps to a Command.

No, we usually want a coarser grain than that. Some tasks do only require a single property, but several properties is a common case.

How are the screens laid out when it's just not practical to isolate a single task?

By grouping together cohesive units; consider the Amazon order workflow -- there are actually several different sets of data collected (the order itself, the selection of payment, specifying new methods of payment, specifying the delivery address, specifying the shipping priority....).

all the while they User is off-line.

See CQRS, not just for server systems; but in broad strokes - treat the data collected from the user as events (FormSubmitted) rather than commands. The offline device is the authority for tracking what the user did while off line; but the unavailable server is still the authority for the consequences of those events. So the server is responsible for the merge when the client reconnects.

The precise details might vary from one domain to another -- for instance, in a warehousing system, where the offline device has been collecting information about inventory, you might handle the inconsistencies that the server observes during the merge by raising exception reports (the device registered this package leaving the warehouse, but we have no record of it entering the warehouse).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!