29

I came across a new term named CQRS (Command Query Responsibility Segregation) which states that the conceptual model should be split into command model and query model as a typical CRUD model in which the command and query happens in the same model. The article has all theory information.

I don't understand how I should implement this in a project with ASP.net MVC3, EF 4.3 and jQuery.

Can anybody suggest me how to practically implement it in my project?

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
Jack
  • 7,433
  • 22
  • 63
  • 107
  • 3
    the most important thing is : do you need it? have a go on a green project, and try various real world scenarios. CQRS needs some extras that might turn a simple project into a complex one. – Arthis Oct 12 '12 at 08:32
  • http://cqrs.nu/ (DDD + CQRS + event sourcing) – Søren Feb 03 '15 at 12:07
  • There's an article over on github about converting an existing project from a basic MVC over entity framework site to use aspects of CQRS - https://github.com/Chinchilla-Software-Com/CQRS/wiki/Tutorial-0:-Quick-Northwind-sample. you might find that of use. – cdmdotnet Apr 17 '16 at 09:49

5 Answers5

31

CQRS Journey is a good place to start. I also suggest you watch A Journey into CQRS on Channel9.

Anyway, the best thing to learn CQRS is to try it by yourself. For me, I have to learn how to adapt it to my projects for around 6 months.

Ekk
  • 5,627
  • 19
  • 27
  • 5
    The _CQRS Journey_ is useless. The only thing you learn from it is what the pattern is about - an this is only one sentence - but there is not a single example how to implement it. Several pages about some stuff that doesn't help anyone. – t3chb0t Dec 18 '16 at 11:29
5

This article has a detailed explanation. introduction to cqrs

Gabriel Mongeon
  • 7,251
  • 3
  • 32
  • 35
Guillaume Schuermans
  • 906
  • 2
  • 12
  • 28
  • The CQRS implementation is completely wrong. It's build upon a repository that has the methods `Save` and `Get` which clearly violates the CQRS pattern. Why should I implement such an overengineered CQRS layer/abstraction on top of it? It's insane. – t3chb0t Dec 18 '16 at 11:33
3

Here you can find sample code for asp.net mvc with cqrs. CQRS with MVC. Find more video here CQRS with ASP.NET MVC - A Year On

Kalu Singh Rao
  • 1,671
  • 1
  • 16
  • 21
1

I want to point out the classic example from Greg Young himself: Simple CQRS example

Narvalex
  • 1,824
  • 2
  • 18
  • 27
  • 1
    Link-only answers can become invalid if the linked page changes. It is better to include the essential parts of the answer here and provide the link for reference. – carlodurso Jan 05 '15 at 21:26
1

Take a look at Its.CQRS: https://github.com/jonsequitur/Its.Cqrs which is being used in production at Microsoft.

Suraj
  • 35,905
  • 47
  • 139
  • 250