Jul 27, 2007

Where custom Exceptions should derive from?

A common question is whether your application specific exceptions should base on System.ApplicationException or from System.Exception?

I stick to Cwalina/Abrams (Framework Design Guidelines/Addison Wesley) position to use System.Exception as a base class.

The reason for this is that ApplicationException was indeed once thought as a base for all custom application exceptions, but was misused in some .NET framework exceptions as well.

No comments:

Post a Comment