– Bertrand Meyer / Object-oriented So5ware Construc:on (1988)
“Every method should either be a command that performs an ac7on, or a
query that returns data to the caller, but not both. In other words, asking a
ques7on should not change the answer.”
“One ques7on that has been hiAng me is whether or not this is something
that may work as a paBern at the object granularity as opposed to the
endpoint as many of these types of paBerns are relevant to both scopes.”
– Greg Young / hDp://codebeDer.com/gregyoung/2009/08/13/command-query-separa:on/
–Mar:n Fowler
hDps://mar:nfowler.com/eaaDev/EventSourcing.html
“Event Sourcing ensures that all changes to applica7on state are stored as a
sequence of events. Not just can we query these events, we can also use the
event log to reconstruct past states, and as a founda7on to automa7cally
adjust the state to cope with retroac7ve changes.”
What have we gained?
(1) System can be put it any prior state
(2) Temporal queries
(3) Future needs
(4) TesDng is easier as there is no update and delete
(5) Distributed transacDons possible
(6) Complete state reconstrucDon at any Dme!
(7) Easier replicaDon/backups
(8) Regulatory compliance