Wednesday, January 30, 2008

Still Alive!

So, it's probably not surprising that everyone thinks that NValidate is dead. There's been no activity on the forums since November or so, and the blog hasn't seen a post since October 24th. Since the alpha release, things have been pretty darned quiet.

A lot of that has to do with the nature of my job, and the shortage of time it imposes on me. I am the sole developer at a company that churns out massive amounts of code to support a government agency. It's a grueling task that requires me to wear 14 hats, while only getting paid for one of them. The job pretty much consumes my life, and by the time I get home, staring at a computer is usually the last thing that I want to do. So NValidate hasn't exactly been a priority of late. But things are changing, and I've been refocusing my priorities so that I can once again put some balance back into the things that are important to me. So NValidate, a project near and dear to my heart, has once again reached its proper place of prominence.

What's Happened Recently

Some time ago, shortly after the creation of the website, in fact, I had submitted NValidate to Google for inclusion in their search engine. It took what seemed like forever for that to happen. I took that, in my naiveté, to mean that they'd denied the request. What I should have considered was the massive number of requests that they probably get for sites to include in the search engine. But we've finally been included. So now, perhaps, interest in NValidate will increase, and we'll get more folks actively participating in it.

Performance Improvements

Recently, NValidate underwent a substantial rewrite of the validators for the value types. In the Alpha release, these had all been derived from a common base class (ValueTypeValidator), which provided a set of tests that were common to all value types. But the performance penalty for using inheritance for the value type validators turned out to be fairly severe.

Is and IsNot

As was noted in the Known Issues forums, these weren't fully implemented across all the classes derived from ObjectValidatorBase. I've finished this off, so that the tests are fully implemented.

New Test: IsNotNegative()

Somehow, this simple test got overlooked. I've added it to all the signed numeric types. Essentially, it throws an ArgumentOutOfRangeException exception if the parameter's value is less than zero. It should be cleaner than invoking IsGreaterThan(0).

New Tests for ArrayValidator

One of my brainier ideas was to review the source code for some of the open source projects out there, and see what some of the parameter validations were that they were doing that I might have overlooked. Arrays, apparently, are an area where I've not been doing a lot of work. (I tend to use collections more often than not, but that's likely because I come from a VB background, and only recently started working with arrays for their performance benefits.)

In reviewing some of the source code, I noticed that a few tests would be really useful. So here are a few of them:

  • HasRanks(int): Throws an ArgumentException if the array doesn't have the specified number of dimensions.
  • IsMultidimensional: Throws an ArgumentException if the array doesn't have more than one dimension.
  • IsNotMultidemnsional: Throws an ArgumentException if the array has more than one dimension.

 

Where We're Going

I'm hoping to create an entry on CodeProject or something similar, and have it point to NValidate.Org. I need to drive up community participation. Visibility is everything.

I'd also like to get more ideas for ways to improve the NValidate framework. More eyes will improve it.

The one part of the system that bugs me most is its extensibility.I'm really interested to hear what others would do to make it more extensible--how would they improve on the ability to plug in their support for unsupported tests and types without seriously degrading performance? That's a vexing problem.

Until next time!

1 comment:

Anonymous said...

Wrote a quick post about NValidate @ http://www.rocksthoughts.com/blog/archive/2008/02/13/nvalidate.aspx