淺談CQRS
CQS
function Array() {
this.arr = []
}
// Insert 屬於 "Command" 因為所執行的事情是將element 存入 arr 中,改變了狀態
Array.prototype.Insert = function (element) {
this.arr.push(element)
}
// Read 屬於 "Query" 因為只是讀取並未改變Array 整個物件的狀態
Array.prototype.Read = function (index) {
return this.arr[index]
}CQRS

參考資料
PreviousDomain Model: 從無到有規劃新的服務NextBackend System in Microservice Architecture: Where Does data store?
Last updated