I am developing an n-tier multi-user web application using asp.net Mvc 5.
At my service level, I define custom events for each important action and raise these events after completing these actions. for instance
Public event EventHandler EntityCreated;
Public void Create(Entity item) {
Save(item);
......
EntityCreated(this, item);
}
I intend to connect business rules and notifications to these events. The main reason I want to use events is the decoupling of the logic and the ease of connecting additional event handlers without changing my level of service.
Question:
Does it make sense to use events and delegates in asp.net?
Most of the examples that I find on the Internet are for win forms or wpf. I get an edge when it comes to multithreaded applications. Events are also defined once in the form and are active for the form's lifetime.
But in my case, the events will be behind the HTTP request . So is this the overhead defining these events?
source
share