[bv-dev] Hosting of method validation methods

Emmanuel Bernard emmanuel at hibernate.org
Mon Aug 27 09:37:24 EDT 2012


On 27 août 2012, at 10:51, Gunnar Morling wrote:
> For the “getter“ approach, getMethodValidator() would be defined on ValidatorFactory, right? At least that was the original idea.
> 

Ah. I was thinking `getMethodValidator()` was hosted to `Validator`. The negative I could see are:

1. `ValidatorContext` needs to be updated too
2. we would require to allow injection of `MethodValidator` in injectable environments
3. we will need to duplicate `getConstraintsForClass` and `unwrap` in `MethodValidator`

Independently, they don't weight much (except point 3) but as a whole I wonder if that's the right approach.
What would be the negative points of putting it on `Validator`? It requires one extra method call. Any other?

Emmanuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20120827/1aa63be9/attachment.html 


More information about the beanvalidation-dev mailing list