<p>Hi,</p>
<p>What do you other guys think?</p>
<p>I'll go and create a branch to play around a bit with a separate MethodValidator interface. Maybe it helps to have something more specific which we then can compare and discuss.</p>
<p>--Gunnar</p>
<div class="gmail_quote">Am 26.07.2012 10:38 schrieb "Hardy Ferentschik" <<a href="mailto:hardy@hibernate.org">hardy@hibernate.org</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Jul 25, 2012, at 12:00 AM, Gunnar Morling wrote:<br>
<br>
> Hi,<br>
><br>
> 2012/7/23 Hardy Ferentschik <<a href="mailto:hardy@hibernate.org">hardy@hibernate.org</a>>:<br>
>> Hi all,<br>
>><br>
>> Let me pick up yet another TODO from the current spec.<br>
>><br>
>> Section "5.1.2. Method-level validation methods" [1] still contains a TODO whether the methods for method validation should be hosted<br>
>> on a different interface (other than javax.validation.Validator).<br>
>><br>
>> At the moment all validation methods are hosted on javax.validation.Validator. Personally I don't see a strong reason for introducing<br>
>> another indirection/interface. Does anyone have objections removing the todo?<br>
><br>
> I guess Emmanuel does :)<br>
><br>
> Personally, I also used to be of the opinion that a separate interface<br>
> doesn't really add much value. What made me pondering though was the<br>
> recent discussion about adding new bean validation methods such as<br>
> validateProperty(T object, Path property, Class<?>... groups);<br>
><br>
> Following the interface segregation principle [1], it may indeed be a<br>
> good idea to have two separate interfaces, one for standard bean<br>
> validation and one for method validation. I think the main question<br>
> is, who the consumers of the individual methods are. I think there may<br>
> be a broader range of users of the bean validation methods<br>
> (validate(), validateProperty() etc.) than of the method validation<br>
> methods (validateParameters() etc.), which typically will only be<br>
> invoked by authors of integration/glue code. So for users of the first<br>
> group it would reduce complexity if the method validation stuff went<br>
> into a separate interface.<br>
><br>
> With respect to retrieving method validators, instead of something<br>
> like Validator#forMethod(Method method) etc. I could also imagine<br>
> ValidatorFactory#getMethodValidator(). Then one doesn't have to<br>
> retrieve a new validator for each validated method/constructor.<br>
<br>
+1 for ValidatorFactory#getMethodValidator() in case we decide separate interfaces<br>
<br>
<br>
--Hardy<br>
<br>
<br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</blockquote></div>