Online Mind Mapping and Brainstorming

Create your own awesome maps

Online Mind Mapping and Brainstorming

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account? Log In

CQRS by Mind Map: CQRS
5.0 stars - 1 reviews range from 0 to 5

CQRS

Command

A command is a simple object with a name of an operation and the data required to perform that operation.

Example: RelocateCustomerCommand

Is immutable (when using Messaging Pattern)

Is a method call (When not using the Messaging Pattern)

Execution may fail (with an exception)

QUESTION: Should value objects be used in commands?

Command Handler

Handles one or more commands

May refuse to execute the command by throwing an exception

Workflow

Called Saga by Greg Young

Term "Saga" introduced by Hector Garcia-Molina and Kenneth Salem in 1987

Listens to events

Sends Commands & Events

Business Process Model and Notation (BPMN)

Saga vs. State Machine vs. Workflow (Kelly Sommers)

Event

Is immutable

Named with a verb in the past tense

Example: CustomerRelocatedEvent

Never fails (as it already happened)

Related concepts

Messaging Pattern

Event Sourcing

Design by contract (DBC)

Eventual Consistency

Task Based UI

Behavior-driven development (BDD)

Fast Command Bus

Based on "Command Query Separation" (CQS) idea from Betrand Meyer

Projector

Listens for events

Creates and manages views

Projects incoming events to a view

View

A representation of the system for a special purpose

Could also be another model like an UML diagram, a Java class, Excel file, XML file or a chart

Query