Home All Groups Group Topic Archive Search About

General Design Question - Class Name

Author
27 Apr 2006 5:33 PM
Mythran
I'm in need of some suggestions.  Currently, we have a class that is named
StringValidator.  It has methods such as ValidateMaxLength,
ValidateMinLength, IsNumber, IsMatch, ValidateNumeric, ValidateInteger, etc.
There is custom validation for each method (such as IsNumber compared to
IsNumeric) and overloads (lots) for each that allow passing a string, a
DataRow and ColumnName, a DataColumn and DataRow, etc.  The suggestion(s) I
am in need of is a class name that better suits it.

StringValidator just doesn't sound right to us and I would like some
alternative ideas for it :)

Our namespace is MCIS.Libraries.Validation and the class would go under this
(which will probably be changed to MCIS.Libraries.Data.Validation).  So
Validation would not be a good name for the class either :)

Thanks,
Mythran

Author
27 Apr 2006 5:46 PM
Tim
"class1" always works for me :-)
Author
27 Apr 2006 6:02 PM
Lucian Wischik
"Mythran" <kip_potter@hotmail.comREMOVETRAIL> wrote:
>I'm in need of some suggestions.  Currently, we have a class that is named
>StringValidator.  It has methods such as ValidateMaxLength,
>ValidateMinLength, IsNumber, IsMatch, ValidateNumeric, ValidateInteger, etc.
>There is custom validation for each method (such as IsNumber compared to
>IsNumeric) and overloads (lots) for each that allow passing a string, a
>DataRow and ColumnName, a DataColumn and DataRow, etc.  The suggestion(s) I
>am in need of is a class name that better suits it.

I'd get rid of it...

Instead have a family of static functions which produce Regex strings
to check for MaxLength, MinLength, IsNumber, ...

As for DataRow/whatever, what you're doing is unrelated to validation.
Instead you're producing "map/fold"-like adapters which work over
various kinds of data structures. So these could be more abstracted.

--
Lucian
Author
27 Apr 2006 8:21 PM
AMercer
How about Checker, Conformity, or Rational, or variants thereof?

Show quoteHide quote
"Mythran" wrote:

> I'm in need of some suggestions.  Currently, we have a class that is named
> StringValidator.  It has methods such as ValidateMaxLength,
> ValidateMinLength, IsNumber, IsMatch, ValidateNumeric, ValidateInteger, etc.
> There is custom validation for each method (such as IsNumber compared to
> IsNumeric) and overloads (lots) for each that allow passing a string, a
> DataRow and ColumnName, a DataColumn and DataRow, etc.  The suggestion(s) I
> am in need of is a class name that better suits it.
>
> StringValidator just doesn't sound right to us and I would like some
> alternative ideas for it :)
>
> Our namespace is MCIS.Libraries.Validation and the class would go under this
> (which will probably be changed to MCIS.Libraries.Data.Validation).  So
> Validation would not be a good name for the class either :)
>
> Thanks,
> Mythran
>
>