Why does the CQS principle require a Command not to return any value? -


the cqs principle says every method should either command performs action, or query returns data caller, not both. makes sense query not else, because don't expect query change state. looks harmless if command returns piece of information. can either use returned value or ignore it. why cqs principle require command not return values?

from understanding, 1 of benefits of cqs how works in distributed environments. commands become own isolated unit executed, placed in queue executed @ later date, executed remote event handler etc.

if commander interface specify return type affect strength of cqs pattern in ability fit within distributed model.

the common approach solving problem (see article instance mark seemann) generate unique id such guid unique event executed command handler. persisted allow data identified @ later date.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -