by sampsonetics · 10y ago · 0 comments
CQS is an old OO design principle suggesting that an object's behavior is easier to reason about if every method either changes the state of the object or interrogates its current state. That's not always possible, but it's a helpful habit.
CQRS is the idea that use cases involving searching and reporting across many entities are fundamentally different from use cases involving interactions with particular entities. It is therefore sometimes worthwhile to develop separate data models for searching and reporting that are updated asynchronously.
[1] https://en.wikipedia.org/wiki/Command–query_separation
[2] http://martinfowler.com/bliki/CQRS.html
[3] http://martinfowler.com/bliki/CommandQuerySeparation.html
No comments yet.