1

I have adopted the Command Query Separation principle in a project.

However, I am not adhering to it strictly as we have a need for Commands to return values.

Many people refer to this article which is a great explanation of this concept:

However, one statement in here goes unexplained:

https://blogs.cuttingedge.it/steven/posts/2012/returning-data-from-command-handlers/

"...returning values from commands does mean that a command can never be executed asynchronously anymore"

Can anyone elaborate on this?

Why would returning a value from a Command mean that they can no longer be executed asynchronously?

JTech
  • 3,420
  • 7
  • 44
  • 51

1 Answers1

0

Here the notion of "asynchronously" means you're not waiting on the result as a dependency to perform some other task, like insert child records with the parent record ID returned from the 'create parent' command. Indeed, the 'Update' at the top of the article you referenced does say exactly that: the client should create identifiers for records inserted into a database, and this allows perfect implementation of CQ(R)S.

user1969177
  • 786
  • 5
  • 8