Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anything Wrong with Creating An ExceptionOccurred Event
Message
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01417957
Message ID:
01418108
Vues:
52
>Anyone see anything wrong with create an event to raise when an exception occurs?

Yes. This sounds like you try to implement VFP's error event. Exception handling and error event are contrary concepts that don't go very well together.

An exception that isn't handled in your code should be passed on the calling hierarchy. I think this becomes obvious if you don't look at the simple scenario of A calling B, but A calling B calling C. If component C has an ExceptionOccured event, suddenly A and B have to subscribe to the event of component C. That means A suddenly needs to know about implementation details and calling hierarchies in component B. Or, component B would need another event that A subscribes too which passes on the exception. That would merely simulate exception handling but require a lot of code and makes it easy to break the chain accidentally.
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform