Hi,
I've been studying on CQRS and DDD-concepts for a while now,
and I think it's safe to assume that I understand the basics of the
approaches, not only how to apply them but also when (not) to apply
them. However, there's one thing I can't really find an answer to in the
theory, so I figured I'd just ask it here: is CQRS really only
recommended when you have a collaborative domain (and considered
over-engineering for all the other cases), or are there other valid
arguments to apply a (subset) of the CQRS-techniques in domains of
reasonable complexity?
For example, I've read virtually everywhere that if a domain is
complex enough (or anticipated to change frequently and/or grow in
complexity), DDD might be your friend. In addition, it's highly
recommended not to build a domain-model that's also used for querying,
thereby avoiding a hybrid model. So in fact it is recommended to
separate your business logic side from your query side, basically
applying CQRS, if you choose to apply DDD, right? Now if we assume that
not every business case that lends itself to be solved elegantly with
DDD is a collaborative domain, you can see that you may want to apply
CQRS for systems that are not necessarily a collaborative domain.
I can also think of situations where you wouldn't want to apply a
full-fledged CQRS-approach, incorporating true asynchronous commands
fired from the UI or have to setup an EventStore, but only apply the
concepts of CQRS inside a component/service, behind your legacy,
non-CQRS WCF-webservice. For example, in my opinion you could simply
transform or use the arguments of a regular RPC-call to perform a (synchronous)
call to an internal command-processor, wait for it to return, and then
immediately query your read-model (or pick up any domain-events) to provide a result. Does anyone
think this would be a valid approach (using CQRS only inside a
component for domain-model separation and testability-improvement)?