cqrs

CQRS - Single command handler?

删除回忆录丶 提交于 2019-12-21 18:45:07
问题 I´m just trying to wrap my head around CQRS(/ES). I have not done anything serious with CQRS. Probably I´m just missing something very fundamental right now. Currently I´m reading "Exploring CQRS and Event Sourcing". There is one sentence that somehow puzzles my in regards of commands: "A single recipient processes a command." I´ve seen this also in the CQRS sample application from Greg Young (FakeBus.cs) where an exception is thrown when more then one command handler is registered for any

CQRS Validation & uniqueness

假如想象 提交于 2019-12-21 12:14:06
问题 In my CQRS architecture, I'd like to validate that when I send a InsertSettingCommand (setting is a key/value object), I want to check that the key doesn't already exist in my database. If I understand CQRS & validation well, it says that the validation should be performed in client side only when it's about verifying some formatting stuffs like checking that email respects some syntax or that customer's name is not empty. But in my case, I need to query my database to see if it exists, but I

CQRS Read Model Design when Event Sourcing with a Parent-Child-GrandChild… relationship

家住魔仙堡 提交于 2019-12-21 07:56:03
问题 I'm in the process of writing my first CQRS application, let's say my system dispatches the following commands: CreateContingent (Id, Name) CreateTeam (Id, Name) AssignTeamToContingent (TeamId, ContingentId) CreateParticipant (Id, Name) AssignParticipantToTeam (ParticipantId, TeamId) Currently, these result in identical events, just worded in the past tense (ContingentCreated, TeamCreated, etc) but they contain the same properties. (I'm not so sure that is correct and is one of my questions)

Implementing set-based constraints in CQRS

泪湿孤枕 提交于 2019-12-20 10:13:16
问题 I'm still struggling with what must be basic (and resolved) issues related to CQRS style architecture: How do we implement business rules that rely on a set of Aggregate Roots? Take, as an example, a booking application. It may enable you to book tickets for a concert, seats for a movie or a table at a restaurant. In all cases, there's only going to be a limited number of 'items' for sale. Let's imagine that the event or place is very popular. When sales open for a new event or time slot,

Read side implementation approaches using CQRS

不打扰是莪最后的温柔 提交于 2019-12-20 09:00:09
问题 I've moved to the project which is actively using CQRS + event sourcing. From the first glance it's implemented in accordance with all those books and blogs, but finally I realized what exactly is peevish in the implementation. Here is CQRS architecture: Originally I took this picture from here. As we can see in the picture, the read side receives events from the queue and passes it one by one into different sets of projections(denormalizers) and then resulting ViewModels are saved through

Real life experience with the Axon Framework [closed]

戏子无情 提交于 2019-12-20 08:39:31
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 10 months ago . As part of researching CQRS for use with a project, I ran across the Axon Framework, and I was wondering if anyone has any real life experience with it. Just to be clear, I'm asking about the framework, not CQRS as an architectural pattern. My project already uses Spring

Applying CQRS - Is unit testing the thin read layer necessary?

女生的网名这么多〃 提交于 2019-12-18 19:16:08
问题 Given that some of the advice for implementing CQRS advocates fairly close-to-the-metal query implementation, such as ADO.NET queries directly against the database (or perhaps a LINQ-based ORM), is it a mistake to try and unit test them? I wonder if it's really even necessary? My thoughts on the matter: The additional architectural complexity to provide a mockable "Thin Read Layer" seems opposite to the very nature of the advice to keep the architectural ceremony to a minimum. The number of

Occasionally connected CQRS system

扶醉桌前 提交于 2019-12-18 12:19:59
问题 Problem: Two employees (A & B) go off-line at the same time while editing customer #123, say version #20, and while off-line continue making changes... Scenarios: 1 - The two employees edit customer #123 and make changes to one or more identical attributes. 2 - The two employees edit customer #123 but DO NOT make the same changes (they cross each other without touching). ... they then both come back on-line, first employee A appends, thereby changing the customer to version #21, then employee

How to write functionality using DDD / CQRS

半腔热情 提交于 2019-12-18 04:16:35
问题 I have a bank account domain as listed below. There can be SavingsAccount, LoanAccount, FixedAccount and so on. One user can have multiple accounts. I need to add a new functionality – get all accounts for a user. Where should be the function written and how? It would be great if the solution follows SOLID principles( Open-Closed principle,…) and DDD. Any refactoring that would make the code better is welcome. Note: The AccountManipulator will be used by a website client over a web service.

Refactoring code to avoid anti-pattern

扶醉桌前 提交于 2019-12-17 05:15:35
问题 I have a BusinessLayer project which has the following code. The domain object is FixedBankAccount (which implements IBankAccount). The repository is made as a public property of the domain object and is made as an interface member. How to refactor it so that repository will not be an interface member ? The domain object (FixedBankAccount) makes use of the repository directly to store the data. Is this a violation of Single Responsibility Principle? How to correct it? Note: The repository