views:

103

answers:

2

Hi,

We are currently finishing an architecture plan for a new software application we are developing next year in ASP.NET MVC / C#.

We are planning to construct the application following Domain-Driven design patterns and techniques and i'm wondering if anyone has any advice / views on an aspect of the proposed system.

One of the business requirements is to allow a user to select any number of business events which they find interesting and then select how they are informed when that event occurs.

I quite like the idea of raising domain-events but i'm struggling to figure out what the best way would be dynamic consume them.

Has anyone built anything similar and could share some advice or thoughts ?

+4  A: 

You may want to take a look at Udi Dahan's post on Business Events.


So how do you go about consuming such events?

In Udi Dahan's post, I get the impression that he simply has an in-process broker (really, an Observer) that notifies all subscribers of events as they occur. This happens unconditionally, so each subscriber essentially works as its own filter, deciding whether or not it wants to deal with the event in question.

As long as raising the event in itself happens in-process, notifying all subscribers might as well happen in-process as well, as long as the broker makes sure that notification happens asynchronously so that subscribers don't block each other (or the business process that triggered the event).

In many cases this will probably be good enough, but in other cases you may want increased scalability or robustness. Such issues can be addressed by (transactional) queues, but obviously at the cost of added complexity. Here the broker still exists, but instead of notifying subscribers directly, it adds a message representing the event to all subscribing queues.

Mark Seemann
Hi,Yes i sure and liked Udi's take on the Domain Event (I did'nt make it very clear that i'd all ready seen it.) The piece i'm missing is the consumption of the event's.Do i set up a broken which listen's for every event and then make decisions on whether they should be passed onto the interested user ?If this is out-of the running process; how do i go about consuming the events ? Should i push them into a message queue of sometype ?Thanks
John Kattenhorn
Fair enough :) I've elaborated my answer a bit.
Mark Seemann
Thanks Mark, it really good food for thought.
John Kattenhorn
+1  A: 

Well you've probably seen Fowler's Domain Event stuff, then. Udi Dahan has one take on implementation here: http://www.udidahan.com/2008/08/25/domain-events-take-2/

Neil Barnwell