Adding new event handlers

2 views
Skip to first unread message

David Thibault

unread,
Sep 8, 2010, 10:10:32 PM9/8/10
to ncqrs-dev
I'm pretty new to CQRS, so this is probably obvious but I'd like some
pointers. At my job we are planning on starting a new project and this
architecture seems to be a great fit for it. I just need to wrap my
head around some concepts first.

Let's say I have an ongoing system, and a new requirement requires me
to add a new read model. So I create new denormalizers for the events
that affect this model, good. Now, how do I go about populating this
read model with the existing events ? My guess would be to get all
events of the types I need to denormalize and simply run them through
my denormalizers in a stub program, but I see no way of doing this in
the current version of Ncqrs. IEventStore does not offer any way to
get all events of a specific type.

Is this simply not implemented yet, and I should just fork the code to
implement this? Or is there some deeper concept that I'm missing?

Thanks!

Szymon Pobiega

unread,
Sep 9, 2010, 12:34:23 AM9/9/10
to ncqr...@googlegroups.com
Hi

No, you're not missing any concepts. All the included event stores implement only whats absolutely necessary for NCQRS to function (process transactions). Because we don't need additional methods (like get all the events) we don't include it in the interface.

Now, you can achieve what you want in two ways:
* extend your favorite event store implementation so that it includes additional methods which will be used in the stub program
* make you stub program work directly against the raw event storage (like SQL Server or RavenDB) bypassing IEventStore altogether. 

My gut feeling is that the latter would be easier, but I can be wrong.

Szymon

2010/9/9 David Thibault <thibaul...@gmail.com>
Reply all
Reply to author
Forward
0 new messages