开发者

Best practice advice in generating and consuming business level events

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 fin开发者_如何转开发d 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 ?


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.


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜