I've been working on open source projects for a while, namely Parrot and Perl 6. Recently I've also been hacking on
TNValidate, a fluent validation library for .Net. To quote a little code from its synopsis:
// Instantiate validator.
var Validate = new Validator(ValidationLanguageEnum.English);
// Chain rules; automated error generation.
Validate.That(Name, "Name").IsLongerThan(3).IsShorterThan(100);
// Supply a custom error message.
Validate.That(Age, "Age").IsGreaterThanOrEqual(13,
"You must be older than 13 to sign up");
// Check if validation suceeded.
if (Validate.HasErrors())
{
// Here you can data-bind the errors, e.g. to a Repeater
// in ASP.NET.
ErrorList.DataSource = Validate.ValidatorResults;
ErrorList.DataBind();
}
else
{
// Was fine, continue...
// ...
}...