Saturday, September 26, 2009

Library Design - Documenting Exceptions

I’m sure most of you might already know but I thought of sharing this. If we are coding for a class library then we should always try to explicitly provide exception type that our code (method) will throw. If we provide exception values in XML Comments then those exceptions will appear in intellisense while we are using that library method. This will be handy for developers using our library. I remember this is also mentioned somewhere in framework design guidelines.
  • Method definition: Explicit exception details provided

  • Method Usage: Intellisense contains list of exceptions

Cheers!
Currently Playing : PROTOTYPE

No comments: