Open Source CQRS C# Library

318 views
Skip to first unread message

Joel Jeremy Marquez

unread,
Jan 11, 2018, 2:22:36 PM1/11/18
to DDD/CQRS
Hi,

I would like to share this C# library that I have been working on to help me on my project. I plan on releasing it as open source. Check it out at my Github: https://github.com/jeyjeyemem/Xer.Cqrs

Basically, it's composed of 3 projects:
1. Command handling library
2. Query handling library
3. Event handling library

I did split it to separate projects so that consumers could only reference what functionality is needed and not include classes that will not be used.

Any feedback would be much appreciated. :)

Thanks!
Message has been deleted

xiety

unread,
Jan 12, 2018, 4:57:54 AM1/12/18
to DDD/CQRS
Thanks for sharing.
It will be more interesting to see complex example with object interactions. For instance, creating purchase order in one BC with posting transactions to the ledger in another BC.

xiety

unread,
Jan 12, 2018, 6:21:26 AM1/12/18
to DDD/CQRS
I thought that CQRS is used to separate read and write databases with denormalisers in between. But your sample uses single repository for both. What's the point?

Joel Jeremy Marquez

unread,
Jan 13, 2018, 1:19:20 AM1/13/18
to DDD/CQRS
I used the same repository just to keep the sample simple. I agree that changing it to a different interface would be more helpful. I'll try changing that. Thanks!

Joel Jeremy Marquez

unread,
Jan 13, 2018, 1:20:18 AM1/13/18
to DDD/CQRS
This is on my todo list. Create more samples. :)

Aratirn Aratirn

unread,
Jan 27, 2018, 4:20:54 AM1/27/18
to DDD/CQRS
As I understand it, CQRS is not about separating into read/write databases (although that is an architectural decision that might be helped by CQRS or not, it is independent of CQRS).
CQRS is about separating (decoupling) read models from write models (models or interfaces, I guess). What that means is that the client no longer writes the data in the same way as it is consumed...

Correct me if I am wrong but at a basic level:

A client can use a Create Command (which might write a new row to a database).
Then, a client can use an EditProperty Command (which might alter the row in the database OR store the resulting delta changes in the database OR even another database, the later being related to Event Sourcing and not CQRS per se).
Then, a client might read a subset of the data as something else (say we store a full record of a user along with profile picture, maybe Client A sees the user as a login, merely username and a password hash while Client B sees the user as a name, surname and profile picture. This part is what makes CQRS so interesting in DDD as it allows for decoupling data from model across domains, offering to different domains different 'representations' of the data).

Disclaimer, I have not yet seen the code, but I thought it was an interesting point to comment on.

Greg Young

unread,
Jan 27, 2018, 8:40:55 AM1/27/18
to ddd...@googlegroups.com
CQRS does not require separate databases it is about separating the write methods of a service and the read methods of a service.

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.



--
Studying for the Turing test

Rickard Öberg

unread,
Jan 27, 2018, 9:12:03 PM1/27/18
to ddd...@googlegroups.com
As an example, in our CQRS/ES app (we use EventStore for long term clustered storage) we have a local dev mode where events are sent straight to the read model updater. So no separate databases, no event store. Works really well, so even if you are “stuck” with having to use just a regular database as infrastructure you can still get the modeling benefits from CQRS.

Sent from my iPad
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages