Command Query Responsibility Segregation design pattern

learn more… | top users | synonyms

0
votes
0answers
81 views

Domain Driven Design - designing Aggregate Roots

Imagine you're designing an application for organazing Workshops. Workshop itself is quite complicated - it acts as a state machine with multiple possible states and transitions between them. We're ...
0
votes
1answer
41 views

Sharing data between bounded contexts

I'm developing a tournament management system that uses a mixture of CQRS/ES/DDD and basic CRUD. I've defined 2 bounded contexts so far: TeamManagement and TournamentManagement. The TeamManagement ...
1
vote
2answers
44 views

What layer generates commands for dependent services?

Our business works with truck drivers making pickups/deliveries of containers. The location of containers needs to be tracked. The drivers use mobile devices to generate a "DriverReport" (a log of ...
1
vote
0answers
89 views

How shall I project CQRS command and query services through WCF

I got directed to this site for more conceptual questions. Here is my issue: Im designing an application that uses CQRS to expose functionality to higher levels in the stack. This looks like below ...
1
vote
1answer
23 views

How to model parallel processes (in a Bounded Context) with the same data store?

The situation. Let's say a background process puts stuff into data containers. It runs all the time, observes system events, and populates the data accordingly. The user may launch a control panel ...
0
votes
1answer
112 views

What is eventual consistency?

I've heard people talking about "eventual consistency" (for example in this question and this answer). What is "eventual consistency"? How does it compare to "transactional consistency"? When does it ...
2
votes
1answer
71 views

Encapsulate one business story/use case in one class?

I don't like classes like *Service, with bunch of business methods - aka anemic model. I was thinking, instead, to have a class per use case. This was inspired (if not the same) from CQRS. Even if we ...
1
vote
1answer
140 views

Version hash to solve Event Sourcing problems

The basic examples I have seen about Event Sourcing do not deal with out of order events, clock offsets in different systems and late events from system partitions. I am wondering if more polished ...
1
vote
2answers
208 views

Managing non-domain application behaviour in CQRS

Here's a scenario. I am building QueueUnderflow, a community-edited Q&A site for people who haven't yet grasped the basics of data structures. My users don't like it when people edit their posts ...
3
votes
2answers
308 views

Where to put format validation in a CQRS “stylish” domain model?

It feels right to put format validation inside the domain objects (VOs or entities) because it is the natural place for high cohesion and the domain knows best what every domain ...
0
votes
0answers
146 views

Entities (DDD) when using CQRS on Akka

When using Akka, CQRS style, is still there a place for Entities? Or does everything now go to Aggregates, implemented as Actors + Value Objects. I notice that most entities are written as mutable ...
3
votes
2answers
1k views

REST Service and CQRS

I am struggling with architecture on a new project. I am using the following patterns/technology. CQRS - anything going in goes through a command REST - using WebAPI MVC - asp.net mvc Angular - ...
0
votes
2answers
635 views

Designing a social network with CQRS, graph databases and relational databases in mind

I have done quite an amount of research on the topic so far, but i couldn't come up with a conclusion to make up my mind. I am designing a social network and during my research i stumbled upon graph ...
1
vote
1answer
282 views

How does a search functionality fit in DDD with CQRS?

In Vaughn Vernon's book Implementing domain driven design and the accompanying sample application I found that he implemented a CQRS approach to the iddd_collaboration bounded context. He presents ...
0
votes
1answer
1k views

Domain Services vs. Factories vs. Aggregate Roots

After dealing with DDD for months now, I'm still confused about the general purposes of domain services, factories and aggregate roots in relation to each other, e.g. where they overlap in their ...
2
votes
0answers
530 views

How Add/Create* commands should be handled in CQRS + Event Sourcing architecture

I want to implement my first application using CQRS pattern along with Event Sourcing. I am wondering how creation of aggregate roots should be handled properly. Let's say someone sends CreateItem ...
1
vote
3answers
172 views

Where should an object in CQRS+ES be fully initialized: in the constructor, or when applying the first event?

There appears to be widespread agreement in the OOP community that the class constructor should not leave an object partly or even fully uninitialized. What do I mean by "initialization"? Roughly ...
1
vote
2answers
3k views

Why separate class CommandHandler with Handle() instead of handling method in Command itself

I have a part of CQRS pattern implemented using S#arp Architecture like this: public class MyCommand { public CustomerId { get; set; } // some other fields } public class ...
4
votes
4answers
352 views

Typed search over complex model. Possible CQRS / NoSQL solution

Given the following relational model: I need to implement a typed search for hotels, which should be able to query on name, city, country, category, hoteltype, roomprice, customtype, room custom ...
3
votes
1answer
515 views

Pushing complete notifications to client

So with cqrs, we accept that consistency is eventual. However, that doesn't mean that the user has to continually poll, or that eventual means an update has to take more then 500ms to sync. For ...
8
votes
3answers
839 views

I have to compromise: DRY, or Command-Query-Separation?

I was recently refactoring a method that was both a command and a query method. After separating it into a one command method and one query method, I found that there are now multiple places in the ...
4
votes
1answer
129 views

CQRS and validations

I'm starting to introduce myself in CQRS concepts, but I get stucked with the following situation: Supouse you have an entity that must have an unique name. In order to verify that, prior to create ...
1
vote
2answers
1k views

Audit trails and recording actions

Background A discussion that has come up at work recently is how we handle audit logging and the recording of events. We are integrating with a 3rd party app so triggers are a no no from the off so ...
1
vote
1answer
985 views

CQRS with Repository pattern and Inversion of Control (with DI)

I assigned a POC project to someone where I asked to implement both Command Query Responsibility Segregation, Inversion of Control (with Dependency Injection) and Repository pattern. “Someone” gave ...
3
votes
1answer
469 views

Distinguishing between UI command & domain commands

I am building a WPF client application using the MVVM pattern that provides an interface on top of an existing set of business logic residing in a library which is shared with other applications. The ...
1
vote
1answer
399 views

Separation versus Segregation

The term "segregation" is used in the CQRS pattern. What's the difference between segregation versus separation in this case?
3
votes
2answers
606 views

Inheritance, commands and event sourcing

In order not to redo things several times I wanted to factorize common stuff. For Instance, let's say we have a cow and a horse. The cow produces milk, the horse runs fast, but both eat grass. ...
4
votes
1answer
805 views

Distributed application using RabbitMQ

I am on my way to create an application with 4 bounded context using CQRS & event sourcing. In order to make these bounded context talk to each other I was planning on using Rabbit MQ. My ...
3
votes
1answer
1k views

CQRS + Event Sourcing: (is it correct that) Commands are generally communicated point-to-point, while Domain Events are communicated through pub/sub?

Didn't know how to shorten that title. I'm basically trying to wrap my head around the concept of CQRS ( http://en.wikipedia.org/wiki/Command-query_separation) and related concepts. Although CQRS ...
8
votes
2answers
3k views

DDD, Saga & Event-sourcing: Can a Compensate Action simply be a delete on the event store?

I realize the above question probably raises a few 'what??'s, but let me try to explain : I'm trying to wrap my head on a couple of related concepts, basically the Saga-pattern ( ...
1
vote
2answers
296 views

Designing a hierarchical structure with lots of reads and writes?

I am in the process of working on a video on demand system part of it involves the management of a hierarchical tree structure (think windows explorer) which allows users to upload videos, move ...
6
votes
4answers
738 views

Command-Query-Separation and multithreading safe interfaces

I like the command query separation pattern (from OOSC / Eiffel - basically you either return a value or you change the state of the class - but not both). This makes reasoning about the class easier ...
2
votes
1answer
495 views

CQRS and cache invalidation (while load balancing)

I'm slowly trying to migrate our web application to use CQRS principals. In particular, I have separated "write" and "read" interfaces into commands and queries. I have implemented a "reader" ...
8
votes
2answers
6k views

Can SQL Server and Mongo be used together?

We have a large news-oriented site that has high web traffic. The architecture is your often seen DB - Repo Layer - Services Layer - Asp.Net MVC. The problem that we've been seeing is around read ...
10
votes
3answers
2k views

Are Domain Objects in Domain Driven Design only supposed to be write-only?

I've been reading about Domain Driven Design for almost two years and have been cautiously been introducing some concepts in to my daily work or at least making plans for how things I do regularly ...
3
votes
1answer
1k views

Is there a mature, easy-to-use CQRS framework that is not Azure-specific, not outdated, or not well adopted?

I've been doing research on .net implementations with CQRS. Either everything I've seen so far is do-it-yourself, azure-specific, outdated (i think), or not well adopted Problems: Scritchy - is not ...
6
votes
1answer
1k views

CQRS without using others patterns

I would like to explain CQRS to my team of developers. I just can't figure out how to explain it in the simplest way so they can implement the pattern rapidly without any others frameworks. I've read ...
12
votes
5answers
4k views

Is it bad practice for services to share a database in SOA?

I have recently been reading Hohpe and Woolf's Enterprise Integration Patterns, some of Thomas Erl's books on SOA and watching various videos and podcasts by Udi Dahan et al. on CQRS and Event Driven ...
6
votes
2answers
3k views

Command handlers and DDD

I have an ASP.NET MVC application, that uses a query service to get data and a command service to send commands. My question is about the command part. If a request comes in, the command service uses ...
5
votes
3answers
901 views

What is the best way to scale a CQRS system?

In the previous months I have been asking a lot of questions concerning the architecture of an application I'm working on. Thanks to the answers the architectural design has changed - in fact, it has ...
5
votes
1answer
2k views

.NET CQRS Frameworks nCQRS vs Lokad.CQRS

For the last couple of weeks I've been reading up and watching any resources I can find on CQRS. I really like the concept and am keen to start delving deeper. I have only found 2 major .NET ...
2
votes
2answers
602 views

CQRS applicability when some commands need to block the UI

I am working on an app which I would dearly love to transition from a fairly traditional layered architecture to CQRS, for a number of reasons, not least fo which is that having a robust event log ...