understanding CQRS structure


Is this group for experts? Can i ask basic question please as I am new to CQRS?

As i understood so far , There is presentation layer --> Domain Layer —> Interface Layer

So CQRS sits in Domain Layer, so what is the class level structure in Domain Layer?

a) Which will be first class in Domain layer with which Presentation layer will interact, I mean Wud it be controller?
b) What is relation between Aggregate root , domain Model and commands?

i read a lot of doc, but i am confused which class to talk with which?
It would be really helpful if someone could please explain ?

Hi Venus,

this mailinglist is definitely not for experts only.
In my opinion, layers aren’t as important as they used to be in a CQRS based architecture. There is still a separation of different concerns, but the concept of “layer” is not the best match here.

CQRS is an architectural design pattern that exceeds any single “layer” in your architecture. One could even argue it replaces layers altogether.

Your presentation components interact with the domain, either through Commands (to change something), or through Queries (to display information). A Command arrives at an Aggregate, where state changes are validated and reported through events. These Events are handled by Event Handlers, which update certain Query Models (as well as other things that need to be triggered by events). When the UI sends a Query, it is handled by a Query Handler, which uses the Query Models to build a response.

Microsoft has written a pretty comprehensible book on CQRS, which is freely available for download: https://msdn.microsoft.com/en-us/library/jj554200.aspx
Alternatively, have a look at a webinar I did together with Pivotal: https://www.youtube.com/watch?v=Jp-rW-XOYzA