Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exception Handling in n-tier application
Message
De
25/03/2008 16:01:26
 
 
À
25/03/2008 15:06:23
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01305376
Message ID:
01305427
Vues:
6
IMO, you should have a try/catch in the top level to catch anything that isn't handled. If not, there may be many things that just display "Unhandled exception" rather than something understandable to the user.

>I have been reading a few MS books and they seem to have different advice on how to handle Exceptions in a n-tier application. The Microsoft 70-536 training guide states that all code besides simple variable declarations should be included within a Try Catch block. The Framework Design Guidelines from the Microsoft Development Series states that only exceptions where you have explicit procedures to handle the specific error, and that you should never catch a base type Exception, rather, you should have the application crash.
>
>I understand the basic functionality of Exception Handling, but I am trying to find the best way do it. Before I had all of the code in the DataAccess class wrapped in a Try Catch block, where if it was a base Exception I would rethrow the exception. I would do the same thing in the BusinessLogic class, and in my UI class I would have all of the code wrapped in Try Catch blocks, but handling the exceptions appropriately. This seems to be the wrong way to go about this.
>
>Can somebody explain their Exception Handling framework? Thanks!
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform