M
Mike Hofer
Please forgive the cross-post to multiple forums. I did it
intentionally, but I *think* it was appropriate given the nature of my
question.
I'm working on an open source code library to help automate and clean
up parameter validation code. It's almost ready to go into open beta.
But one last little glitch is holding me up, and that would be the
name of the factory class that serves as the entry point into the
library: Validate.
Essentially, when you invoke the methods in this thing, your code
looks like this:
Validate.That(foo,
"foo").IsNotNull().StartsWith("bar").EndsWith("baz")
This works beautifully so far, but it becomes problematic when you use
it from ASP.NET pages, where a Validate method is already defined. As
you can imagine, the compiler thinks you're trying to invoke the
Validate method on the page; so invoking one of the That methods on
the Validate class (a factory) makes no sense.
You can get around it by using an alias with the namespace and change
to Verify or something:
using NValidate.Framework.Validate = Verify;
However, this creates a lot of manual work for the developer. It would
seem that the onus is on *me* as the publisher of the library to come
up with a solution. I mean, the whole POINT of this thing is to make
our lives easier.
So here's what I'm thinking: I could change the name of the Validate
class to Verify. That gets around the whole problem with ASP.NET
pages. That leaves only the following real concerns:
1.) Verify, like Validate before it, is a *very* common word. It's
likely that it will conflict with existing method names.
2.) The product name is NValidate. (Yep, just like NUnit, NCover,
NAnt, etc.) There might be a perceived disconnect between the product
name and the primary entry point into the library itself. (Validate
vs. Verify.)
3.) The classes that validate parameters are called validators. Again,
it's the same disconnect.
My questions for you folks with far greater experience than myself
are:
1.) Is the difference between the product name and the method name
that critical?
2.) Is there a better way to name the factory class?
I'm pretty desperate for input here as this is a one-man project so
far. Any help you big brained-folks can provide will be greatly
appreciated. For those who are interested, I can provide links to the
materials and the source code under development. (I won't spam the
boards--I'm not marketing something here. I'm trying to solve a
problem, and I don't know the best way to do it.)
Again, thanks for your help.
intentionally, but I *think* it was appropriate given the nature of my
question.
I'm working on an open source code library to help automate and clean
up parameter validation code. It's almost ready to go into open beta.
But one last little glitch is holding me up, and that would be the
name of the factory class that serves as the entry point into the
library: Validate.
Essentially, when you invoke the methods in this thing, your code
looks like this:
Validate.That(foo,
"foo").IsNotNull().StartsWith("bar").EndsWith("baz")
This works beautifully so far, but it becomes problematic when you use
it from ASP.NET pages, where a Validate method is already defined. As
you can imagine, the compiler thinks you're trying to invoke the
Validate method on the page; so invoking one of the That methods on
the Validate class (a factory) makes no sense.
You can get around it by using an alias with the namespace and change
to Verify or something:
using NValidate.Framework.Validate = Verify;
However, this creates a lot of manual work for the developer. It would
seem that the onus is on *me* as the publisher of the library to come
up with a solution. I mean, the whole POINT of this thing is to make
our lives easier.
So here's what I'm thinking: I could change the name of the Validate
class to Verify. That gets around the whole problem with ASP.NET
pages. That leaves only the following real concerns:
1.) Verify, like Validate before it, is a *very* common word. It's
likely that it will conflict with existing method names.
2.) The product name is NValidate. (Yep, just like NUnit, NCover,
NAnt, etc.) There might be a perceived disconnect between the product
name and the primary entry point into the library itself. (Validate
vs. Verify.)
3.) The classes that validate parameters are called validators. Again,
it's the same disconnect.
My questions for you folks with far greater experience than myself
are:
1.) Is the difference between the product name and the method name
that critical?
2.) Is there a better way to name the factory class?
I'm pretty desperate for input here as this is a one-man project so
far. Any help you big brained-folks can provide will be greatly
appreciated. For those who are interested, I can provide links to the
materials and the source code under development. (I won't spam the
boards--I'm not marketing something here. I'm trying to solve a
problem, and I don't know the best way to do it.)
Again, thanks for your help.