cqrs

multiple types for SetHandlerInterface() with membus and ioc container

风流意气都作罢 提交于 2019-12-05 06:27:07
Going over demo CQRS code here the command and event handlers are wired up separately as below: public interface CommandHandler<in T> { void Handle(T command); } public interface EventHandler<in T> { void Handle(T @event); } bus = BusSetup.StartWith<Conservative>() .Apply<FlexibleSubscribeAdapter>(a => { a.ByInterface(typeof(IHandleEvent<>)); a.ByInterface(typeof(IHandleCommand<>)); }) .Construct(); I am using an IoC container hooked in with membus and it works a dream by implementing the IEnumerable<object> GetAllInstances(Type desiredType) interface with my container, however unlike the demo

Handling errors/exceptions in a mediator pipeline using CQRS?

筅森魡賤 提交于 2019-12-05 06:17:46
I'm trying to follow this post by Jimmy Bogard to implement a mediator pipeline so I can use pre/post request handlers to do some work. From the comments on that article I come to this github gist . I don't quite understand how to hook all of this up yet, so here is my first go. FYI - I'm using Autofac for DI and Web Api 2. Following CQRS, here is a query. public class GetAccountRequest : IAsyncRequest<GetAccountResponse> { public int Id { get; set; } } //try using fluent validation public class GetAccountRequestValidationHandler : AbstractValidator<GetAccountRequest>, IAsyncPreRequestHandler

Multiple Aggregates Root INSTANCES per transaction

最后都变了- 提交于 2019-12-05 04:25:37
In DDD the Aggregate should represent the transactional boundary. A transaction that requires the involvement of more than one aggregate is often a sign that either the model should be refined, or the transactional requirements should be reviewed, or both. Does it mean the transaction boundary is per aggregate root INSTANCE or per aggregate? Say I have an aggregate root called "Node", within each "Node" I have a collection of "Fields (Value objects)". Each "Field" is of a Type, and can be of Type "Node". In my case, if it is of Type "Node", I will store the Id to the "Node" aggregate Root.

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

你说的曾经没有我的故事 提交于 2019-12-05 01:33:38
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, so that when a user requests to see a feed of messages it reads from EITHER: A denormalized

Reading data from database on Write Side in CQRS

Deadly 提交于 2019-12-05 01:30:18
问题 Background : Diagrams explaining CQRS usually will have clear separation of read and write paths and one-way data flow, like in this example (source : Demystified CQRS) : Question : I would like to clarify, If a Command execution in back-end requires some data from the database, should a "write side" have some read capabilities from write database? or it should completely rely on "read side" for any reads? or perhaps command should contain all the required data supplied by caller to be

Eventual consistency across aggregate roots in the same bounded context using a process manager aka saga

╄→尐↘猪︶ㄣ 提交于 2019-12-04 21:08:41
问题 Suppose you've got two aggregates in your bounded context which have some constraints amongst each other. Using DDD these inter aggregate constraints can't be enforced in the same transaction i.e. the aggregate boundaries are transactional boundaries. Would you consider using what in the Microsoft CQRS journey is called a "process manager" to coordinate two aggregates in the same bounded context or is a process manager only used to coordinate between two bounded contexts? What would the

CQRS: business logic on the query side

和自甴很熟 提交于 2019-12-04 19:47:53
Following the concept of CQRS (Command Query Responsibility Segregation), I am directly referring the DAL in my MVC application and doing all reads via the ViewModels. However a colleague of mine is asking me what will you do when any business logic has to be applied when doing a read. For e.g. if you need to compute a percentage value in scenario like below: //Employee domain object class Employee { string EmpName; Single Wages; } //Constant declared in some utility class. This could be stored in DB also. const Single Tax = 15; //View Model for the Employee Screen class EmployeeViewModel {

RESTful API Design and CQRS

半腔热情 提交于 2019-12-04 14:39:18
I was thinking of how to make a RESTFul API more intention revealing. A common patter I see around various blogs on this is that conventional REST API results in Ban a Player -> POST /players. But I were to change to a more intention revealing interface , I could use Ban a Player -> POST /players/{ playerid }/banPlayer The second one I feel is more intention revealing. The common objection I get from the team is that the second one does not comply with start REST style. Also currently I cannot move away from a RESTful API. I would like to hear your thoughts on this. With Restful API design

J Oliver EventStore V2.0 questions

浪子不回头ぞ 提交于 2019-12-04 13:58:32
问题 I am embarking upon an implementation of a project using CQRS and intend to use the J Oliver EventStore V2.0 as my persistence engine for events. 1) In the documentation, ExampleUsage.cs uses 3 serializers in "BuildSerializer". I presume this is just to show the flexibility of the deserialization process? 2) In the "Restart after failure" case where some events were not dispatched I believe I need startup code that invokes GetUndispatchedCommits() and then dispatch them, correct? 3) Again, in

DDD/CQRS confusion regarding ReadModels and the Domain

寵の児 提交于 2019-12-04 13:12:35
So after much reading I've now come to the realization that complex reporting functions do not belong in your typical Repository and that there needs to be some kind of dedicated "Finder" which returns read only objects to be used in reporting. What I'm unclear on is where the "Finder" classes, as well as their associated ReadModel classes are supposed to go inside my project? Are the finders like repositories in that you have an interface for the finder inside the infrastructure assembly along with concrete Readmodels? Where do these classes belong? I usually have a logical query 'layer'.