cqrs

Alternatives to many-to-many relationships with CQRS

爱⌒轻易说出口 提交于 2019-12-02 14:17:49
How do we model classic many-to-many relationships with CQRS/DDD? I know that both DDD and CQRS implementations and solutions tend to be domain-specific, so it may be difficult to come up with a general answer to this question. However, let's assume we have the familiar relationship between Book and Author . This is a classic many-to-many relationship. To me, it seems most natural that Book and Author are two different Entities that each belong in their own Aggregate Root . Thus, explicitly modeling the many-to-many relationship between them is not the way to go. How do we model an

No registration for type ICommandHandler using SimpleInjector APIv3

我的未来我决定 提交于 2019-12-02 14:08:31
问题 I've been playing around with SimpleInjector and I'm trying to register properly all command handlers. Here is my code: CQRS.cs public interface ICommand {} public interface ICommandDispatcher { void Execute(ICommand command); } public class CommandDispatcher : ICommandDispatcher { private readonly Container container; public CommandDispatcher(Container container) { this.container = container; } public void Execute(ICommand command) { var handlerType = typeof(ICommandHandler<>)

Value Objects in CQRS - where to use

风流意气都作罢 提交于 2019-12-02 14:08:26
Let's say we have CQRS-inspired architecture, with components such as Commands, Domain Model, Domain Events, Read Model DTOs. Of course, we can use Value Objects in our Domain Model. My question is, should they also be used in: Commands Events DTOs I haven't seen any examples where Value Objects (VO) are used in the components mentioned above. Instead, primitive types are used. Maybe it's just the simplistic examples. After all, my understanding of VOs use in DDD is that they act as a glue for the whole application. My motivation: Commands. Let's say user submits a form which contains address

CQRS Event Sourcing: Validate UserName uniqueness

醉酒当歌 提交于 2019-12-02 13:52:15
Let's take a simple "Account Registration" example, here is the flow: User visit website Click "Register" button and fill form, click "Save" button MVC Controller: Validate UserName uniqueness by reading from ReadModel RegisterCommand: Validate UserName uniqueness again (here is the question) Of course, we can validate UserName uniqueness by reading from ReadModel in MVC controller to improve performance and user experience. However, we still need to validate the uniqueness again in RegisterCommand , and obviously, we should NOT access ReadModel in Commands. If we do not use Event Sourcing, we

No registration for type ICommandHandler using SimpleInjector APIv3

自作多情 提交于 2019-12-02 03:58:35
I've been playing around with SimpleInjector and I'm trying to register properly all command handlers. Here is my code: CQRS.cs public interface ICommand {} public interface ICommandDispatcher { void Execute(ICommand command); } public class CommandDispatcher : ICommandDispatcher { private readonly Container container; public CommandDispatcher(Container container) { this.container = container; } public void Execute(ICommand command) { var handlerType = typeof(ICommandHandler<>).MakeGenericType(command.GetType()); dynamic handler = container.GetInstance(handlerType); handler.Handle((dynamic

EasyNetQ fails to publish to RabbitMQ - PersistentChannel timed out

笑着哭i 提交于 2019-12-01 15:24:57
I am trying to connect to RabbitMQ with EasyNetQ. RabbitMQ is on remote VM. _rabbitBus = RabbitHutch.CreateBus( string.Format("host={0};virtualhost={1}", _hostSettings.Host, _hostSettings.VHost), x => x.Register<IEasyNetQLogger>(l => _logger)); _rabbitBus.Subscribe<Message>(_topic, ReceiveMessage, m => m.WithTopic(_topic)); I get a TimeoutException The operation requested on PersistentChannel timed out. . Remote VM is replying to pings, ports 5672 and 15672 are opened (checked with nmap). RabbitMQ management can be accessed from my host. Also, if RabbitMQ is run on my local machine, it works

EasyNetQ fails to publish to RabbitMQ - PersistentChannel timed out

折月煮酒 提交于 2019-12-01 14:18:26
问题 I am trying to connect to RabbitMQ with EasyNetQ. RabbitMQ is on remote VM. _rabbitBus = RabbitHutch.CreateBus( string.Format("host={0};virtualhost={1}", _hostSettings.Host, _hostSettings.VHost), x => x.Register<IEasyNetQLogger>(l => _logger)); _rabbitBus.Subscribe<Message>(_topic, ReceiveMessage, m => m.WithTopic(_topic)); I get a TimeoutException The operation requested on PersistentChannel timed out. . Remote VM is replying to pings, ports 5672 and 15672 are opened (checked with nmap).

Bounded Contexts in DDD with CQRS. Sharing Aggregates/Entities. Possible?

孤街醉人 提交于 2019-12-01 07:32:56
I found this code sample. https://code.google.com/p/ddd-cqrs-sample/ Seems very complete and well organized. Not a "framework", just a sample project with a very granular and explicit ways to do things. BUT, incomplete. And this brings some doubts. They are good at answering questions thou. Check their google group at https://groups.google.com/forum/#!forum/ddd-cqrs-sample OK. Thing is that they have Client in the SALES BC and Customer/Leads in the CRM BC. I think we all agree is pointing at the same "person". Let's say that in the sales funnel, the person starts as a Lead, then becomes a

How to handle CQRS from a client-side perspective

痞子三分冷 提交于 2019-12-01 07:14:06
问题 My company is planning to use CQRS architecture on our back-end but as a client-side developer I'm a bit confused about how to consume a request. Here are the methods that I came up with, none being ideal from my point of view: The server waits until the queue gets processed and gives back the needed data in the response. (sounds like a pretty poor approach from a performance point of view); The client makes the request and gets back a "202 Accepted" once the request was added to the queue,

Bounded Contexts in DDD with CQRS. Sharing Aggregates/Entities. Possible?

你说的曾经没有我的故事 提交于 2019-12-01 06:02:59
问题 I found this code sample. https://code.google.com/p/ddd-cqrs-sample/ Seems very complete and well organized. Not a "framework", just a sample project with a very granular and explicit ways to do things. BUT, incomplete. And this brings some doubts. They are good at answering questions thou. Check their google group at https://groups.google.com/forum/#!forum/ddd-cqrs-sample OK. Thing is that they have Client in the SALES BC and Customer/Leads in the CRM BC. I think we all agree is pointing at