CQRS applicability when some commands need to block the UI
Posted
by
regularfry
on Programmers
See other posts from Programmers
or by regularfry
Published on 2011-06-30T16:29:24Z
Indexed on
2011/07/01
0:29 UTC
Read the original article
Hit count: 294
I am working on an app which I would dearly love to transition from a fairly traditional layered architecture to CQRS, for a number of reasons, not least fo which is that having a robust event log will make adding a couple of feature requests I can see barrelling towards me trivial to accomodate.
Now, I have a conceptual problem: of around 40 commands the user can initiate, there are three which the user needs to be sure have successfully completed before the UI lets them do anything else. Everything else fits into the "submit a request, query for success later" model, except for these three commands.
How is this handled in CQRS-land? Do I separate the three blocking commands to effectively a third service, so I have Commands, Queries, and BlockingCommands? Do I have a two-stage event processor with an in-request blocking first stage which only gets used for the blocking commands? Does the existence of these three commands mean that the whole idea of applying CQRS is invalid? Should I just pretend they aren't blocking and poll for success in the UI?
I'm sure this must come up on other projects, how is it usually handled?
© Programmers or respective owner