Ken Brubaker

The ClavèCoder

<January 2009>
SuMoTuWeThFrSa
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567


Navigation

Subscriptions

News

Kenneth Brubaker
Senior Application Architect

Locations of visitors to this page

Post Categories



Monday, August 02, 2004 - Posts

Exception Design: NotSupportedException or NotImplementedException

Brad Abrams elucidates the difference between NotSupportedException and NotImplementedException:

    • NotSupportedException is for cases where it is ok (that is, by design) to not implement some interface functionality (for example IList.Add(), because IList offers a way to check to see if Add() will throw. 
    • NotImplementedException is for functionality that is just not yet implemented, but really should (and will be).  Something like what you might *start* with when you are building a class, get all the methods there throwing NotImplementedException, then flush them out with real code…

 The comments section has a lively discussion. Someone asked for help changing the tab feature for implementing interfaces. He wants the template to include NotImplementedException. Brad shares how to do it in the VS2005 beta.

I'm all for it. Plus, I'm in favor of an FxCop rule to support the above rule.

 

posted Monday, August 02, 2004 6:36 AM by kenbrubaker with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems