From the course: Java EE: Design Patterns and Architecture

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

What is CQRS architecture?

What is CQRS architecture?

From the course: Java EE: Design Patterns and Architecture

Start my 1-month free trial

What is CQRS architecture?

- [Instructor] CQRS stands for Command Query Responsibility Segregation. It means that every method in the system should be either a command that performs an action, but cannot return data, or a query that returns data, but must not change any data. It is a principal of imperative computer programming, devised by Bertrand Meyer back in 1988 in his book Object-Oriented Software Construction. Bertrand said there are two types of methods in object-oriented software. The command method, which modifies the application state, but does not return the value, and the query method, which responds to a query with a return value and does not change application state. He proposed that an application should make a separation of command and query methods where possible. However, this is not always desirable. There are occasions where a method must change a state of a system, but also return the value. A typical example that is often cited is that of popping an item from a stack. Calling the pop…

Contents