cqrs

In DDD and CQRS, for Read queries, what is a strategy that allows for interfaces and easy testing?

穿精又带淫゛_ 提交于 2019-12-11 02:23:38
问题 I'm using PHP/MySQL... I'm using interfaces for repositories on my Domain "command" side. This is going well. But I'm stuck on what to do on the "queries" (read) side. Do I make queries each as separate methods grouped in classes by some common similarity I find? Or do I make each query its own class? How should I go about using interfaces to make testing (and easier replacement later)? Some places I've researched: A github php example An attempt to find the best decoupled approach to the

Mass Transit: ensure message processing order when there are different message types

我们两清 提交于 2019-12-11 02:22:20
问题 I'm new to Mass Transit and I would like to understand if it can helps with my scenario. I'm building a sample application implemented with a CQRS event sourcing architecture and I need a service bus in order to dispatch the events created by the command stack to the query stack denormalizers. Let's suppose of having a single aggregate in our domain, let's call it Photo , and two different domain events: PhotoUploaded and PhotoArchived . Given this scenario, we have two different message

Mediatr - Where is the right place to invalidate/update cache

我的未来我决定 提交于 2019-12-11 01:29:58
问题 This question stems from this other question I had asked about too many interfaces, QCRS and Mediatr library (request/response) Mediatr: reducing number of DI'ed objects I have created bunch of commands and queries and I have bunch of behaviors and one of them being is a Cache behaviour that for every query, cache is checked for the value before the query is actually executed against the db. So far this is working great, but the delima comes in when I have an UpdateSomethingCommand, once I

Dependency Injection: ASP vNext. How is this working?

主宰稳场 提交于 2019-12-10 15:58:30
问题 So in my CQRS-based bug-tracking web-API, I am refactoring my code before progressing and implementing unit tests (which, admittedly, should have come first); I have this class and constructor: public class BugCommandHandler : IBugCommandHandler { private BugContext db; public BugCommandHandler(BugContext bugContext) { db = bugContext; } //Interface implementation } In my controller, I have this: public class BugsController : Controller { private IBugCommandHandler commandHandler; private

Does a CQRS project need a messaging framework like NServiceBus?

有些话、适合烂在心里 提交于 2019-12-10 15:33:46
问题 The last 6 months learning curve have been challenging with CQRS and DDD the main culprits. It has been fun and we are 1/2 way through our project and the area I have not had time to delve into is a messaging framework. Currently I don't use DTC so there is a very good likely hood that if my read model is not updated then I will have inconsistency between the read and write databases. Also my read and write database will be on the same machine. I doubt we will ever put them on separate

End to end example of CQRS implementation on top of AppEngine

半城伤御伤魂 提交于 2019-12-10 12:09:18
问题 All of the infrastructure components required to implement a CQRS based application seem to be out of the box within AppEngine. Unfortunately, I can't find anything related to this subject. Few possible reasons It's a well kept secret beyond "Architecture Astronauts" It's a worthless overkill architecture because AppEngine scales out "by design" It's not mainstream yet However, even if no complete code is available, provided anyone has hints, bits of targeted code, pros/cons regarding CQRS on

CommandHandler decorators dependency

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 11:26:33
问题 I have an issue where I would like my handler to use data generated from the handlers: UpdateUserProfileImageCommandHandlerAuthorizeDecorator UpdateUserProfileImageCommandHandlerUploadDecorator UpdateUserProfileImageCommandHandler My problem is both architectural and performance. UpdateUserCommandHandlerAuthorizeDecorator makes a call to the repository (entityframework) to authorize the user. I have other decorators similar to this that should use and modify entities and send it up the chain.

Design choice for a microservice event-driven architecture

混江龙づ霸主 提交于 2019-12-10 06:18:21
问题 Let's suppose we have the following: DDD aggregates A and B, A can reference B. A microservice managing A that exposes the following commands: create A delete A link A to B unlink A from B A microservice managing B that exposes the following commands: create B delete B A successful creation, deletion, link or unlink always results in the emission of a corresponding event by the microservice that performed the action. What is the best way to design an event-driven architecture for these two

Do I use Azure Table Storage or SQL Azure for our CQRS Read System?

扶醉桌前 提交于 2019-12-10 01:58:58
问题 We are about to implement the Read portion of our CQRS system in-house with the goal being to vastly improve our read performance. Currently our reads are conducted through a web service which runs a Linq-to-SQL query against normalised data, involving some degree of deserialization from an SQL Azure database. The simplified structure of our data is: User Conversation (Grouping of Messages to the same recipients) Message Recipients (Set of Users) I want to move this into a denormalized state,

CQRS/Event sourcing project structure

南笙酒味 提交于 2019-12-09 21:11:34
问题 I have my first CQRS project which uses event sourcing and I was wondering if this type of project should be structured in a different way in Visual studio compared to other projects that involve multiple tiers? For example, in the pastt projects created had layers such as Remoting, App services, domain etc and it was clear each layer/assembly touched the one below it. These assemblies seemed to do a lot and using a tool like NDepend did say much about the structure of the project. However,