|
From: Seth L. <se...@eh...> - 2004-03-11 00:08:07
|
> I suggest that you avoid using the same attribute class for all rules,
> and instead use a type hierarchy :
>
> For example instead of using
>
> @@ValidationRule("range", "minimum=0.0, maximum=100,000.0")
>
> Have a RangeValidationRule class and do this :
>
> @@RangeValidationRule(minimum=0.0, maximum=100000.0)
>
> I think this is better than
>
> @@ValidationRule("range", new NumberRange(0.0, 100,000.0))
Thanks Cameron! That was a great explanation.
I agree with Cameron on the above. I like a type hierarchy much better
than string identifiers. I'm not sure they buy us much, other than
another mapping configuration.
I'm glad to learn we can shorten the attribute declarations by leaving
off the package. Very nice!
Thanks,
Seth
|