tags:

views:

48

answers:

1

Hi

I'm having a project where I'm using nhibernate as orm in my repositories. But after some CQRS reading I want to try and "copy" some of my data to other tabels for view quering/reporting. Meaning when for instance a new customer is created, I would like some of the customer and company information copied to another table, using some joins, just for the purpose of quering them later without having to join and traverse all the way through some different DTO's and other layers, see CQRS :)

Now the issue is how I should implement this? I could make som StoredProcedure syncCustomer to call after my Create Customer is done but is this the way to go?

How could I else do this?

+3  A: 

Paco is right, you should look into event sourcing and potentially using a messaging architecture to support this. Udi Dahan has some great articles that really helped me to understand these concepts better.

In fact, the latest post is about exactly this: http://www.udidahan.com/2009/12/09/clarified-cqrs/

Chris Nicola
thanks, just read read the article. I think I misinterpreted the "how to" a little bit :). I might have a look at the nservice bus
Rasmus Christensen
You don't have to start with a real servicebus. You can start create a small bus (+- 100 LOC) that does just what you need and study NServicebus (or some other esb) later. You can focus on CQRS with a very limited bus. NServicebus and it's concurrents will require a lot of learning hours.
Paco
Again I agree with Paco, I am also fairly new to this stuff and created my own very minimal service bus, it gives you a better idea of the architecture without the overhead.
Chris Nicola