Re: Inheriting from ApplicationException - Taboo? Jeffrey Richter says so...
From: Ignacio Machin \( .NET/ C# MVP \) ("Ignacio)
Date: 10/06/04
- Next message: Doug Thews: "Re: Interesting Delay After Thread.Abort()"
- Previous message: Giovanni: "Strange problem when running a compile Hello World test"
- In reply to: Philip Rieck: "Re: Inheriting from ApplicationException - Taboo? Jeffrey Richter says so..."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 6 Oct 2004 13:58:06 -0400
Hi,
Insteresting read. thanks for the link.
It does have a point, I never catch the ApplicationException, either catch
the particular exception I'm interested or Exception , which I confess that
catch most of the time, almost all of the warnings I get from FxCOP is that,
catching Exception.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Philip Rieck" <junk@mckraken.com> wrote in message news:eaFaiC7qEHA.3988@tk2msftngp13.phx.gbl... > > Daniel has a point - both Jeff Richter and much of the BCL team have said > that APplicationException was a mistake. See the ".Net Framework Standard > Library Annotated Reference Vol1" > > You can see an excerpt of it with the ApplicationException annotations here: > http://blogs.msdn.com/brada/archive/2004/03/25/96251.aspx > > > This quote is from "KC", or "Krzystof Cwalina (Program Manager ,CLR)" > "Designing exception hierarchies is tricky. Well-designed exception > hierarchies are wide, not very deep, and contain only those exceptions for > which there is a programmatic scenario for catching. We added > ApplicationException thinking it would add value by grouping exceptions > declared outside of the .NET Framework, but there is no scenario for > catching ApplicationException and it only adds unnecessary depth to the > hierarchy." > > > "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote > in message news:usBRff6qEHA.332@TK2MSFTNGP14.phx.gbl... > > Hi, > > > > > >> Recommended by whom? Not the same folks who brought us > >> ApplicationException in the first place (the BCL team). They are of the > >> opinion it was a mistake. Do you think there is a value in deriving from > >> ApplicationException vs. Exception? > > > > > > MS ???? > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemapplicationexceptionclasstopic.asp > > > > except: > > ApplicationException is thrown by a user program, not by the common > > language > > runtime. If you are designing an application that needs to create its own > > exceptions, derive from the ApplicationException class. > > ApplicationException > > extends Exception, but does not add new functionality. This exception is > > provided as means to differentiate between exceptions defined by > > applications versus exceptions defined by the system. > > > > As explained ApplicationException function is to differentiate between an > > exception generate by the user code and not by the runtime. In a similar > > way > > that SystemException is the base for several exceptions that are generated > > by the runtime and considered not fatals. > > > > For further info see: > > http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp?frame=false > > > > > > Cheers, > > > > -- > > Ignacio Machin, > > ignacio.machin AT dot.state.fl.us > > Florida Department Of Transportation > > > > > > > >
- Next message: Doug Thews: "Re: Interesting Delay After Thread.Abort()"
- Previous message: Giovanni: "Strange problem when running a compile Hello World test"
- In reply to: Philip Rieck: "Re: Inheriting from ApplicationException - Taboo? Jeffrey Richter says so..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|