Best practice guidelines for creating and consuming business-level events

We are currently finalizing the architecture plan for the new software application that we are developing next year in ASP.NET MVC / C #.

We plan to create an application based on templates and domain management methods, and I am wondering if anyone has any tips / opinions on the aspect of the proposed system.

One of the business requirements is allowing the user to select any number of business events that they find interesting, and then choose how they are informed about the occurrence of this event.

I really like the idea of ​​creating domain events, but I'm struggling to figure out how to dynamically consume them in the best way.

Has anyone built something similar and could share tips or thoughts?

+4
source share
2 answers

You can take a look at the Udi Dahan post in business events .


So how are you going to consume such events?

In the Udi Dahan publication, I get the impression that he just has a broker in the process (indeed, Observer ), which notifies all subscribers about the events as they occur. This happens unconditionally, so each subscriber essentially works as his own filter, deciding whether he wants to deal with the event in question.

While the process of creating an event by itself occurs in the process, notification of all subscribers can also occur in the process, if the broker guarantees that the notification occurs asynchronously so that subscribers do not block each other (or the business process that triggered the event).

In many cases, this is likely to be good enough, but in other cases you may need increased scalability or reliability. Such problems can be solved by (transactional) queues, but, obviously, due to the additional complexity. Here, the broker still exists, but instead of notifying subscribers directly, it adds a message representing the event to all subscription queues.

+4
source

So, you probably saw the Fowler Domain Event . Udi Dahan offers one implementation option here: http://www.udidahan.com/2008/08/25/domain-events-take-2/

+1
source

All Articles