Why I can't add my own event to page life cycle.

Pluggable architecture with interceptor stack implementation is very useful combination. When I need to write infrastructure that need to implement several services for given class / classes I always try to implement interceptor stack with pluggable architecture. Such implementation enable me to add services without changing my code and let the user add his own services and/or set which interceptors will be call and in what order.

 

Event implementation in ASP.NET isn’t base on such architecture they based on several non virtual functions (ProcessRequest->ProcessRequestMain->InitRecursive->LoadRecursive->PreRenderRecursiveInternal->SavePageViewState … ) that call pre-define page events. If I want to add my events to the page life cycle needless to say that implementation of pluggable architecture with interceptor stack could help me a lot. But due to the fact that other implementation chosen it will be nice if one of the methods that manage page process will be virtual and enable me to use pluggable architecture and to add my own events.

No Comments