Alex Rivera | Logout

.NET Guard Class Library?

Asked 2008-11-18T17:17:17.247
19

I'm looking for a library or source code that provides guard methods such as checking for null arguments. Obviously this is rather simple to build, but I'm wondering if there are any out there for .NET already. A basic Google search didn't reveal much.

Edit
Report

1 Answer

1

I recently wrote a post about guard classes (having not found any information either): http://ajdotnet.wordpress.com/2009/08/01/posting-guards-guard-classes-explained/

I also published a respective Guard class implementation (feel free to use this code as is, or to adjust it to your needs): ajdotnet.wordpress.com/guard-class/

With regard to the relationship between Guard classes and Code Contract in .NET 4.0 (successor to Spec#), have a look at the following post: www.leading-edge-dev.de/?p=438

(sorry for the fragmented links, the site only permitted one link...)

HIH, AJ.NET

answered 2009-08-14T06:32:48.853

Your Answer