<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm not sure I follow you exact proposal so let me rephrase and let me know if I am off track.<div><br></div><div>You want we define a service loader&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html">http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html</a> to retrieve the expected DI solution.</div><div><br></div><div>My concern with that is that it's a static solution. What happens if two service providers corresponding to this service are present? Which one to chose and how is the user expected to chose one or the other?</div><div>I feel like we should keep Bean Validation's configuration away from any "static" approach and let people configure two ValidatorFactory completely independently.</div><div><br><div><div>On 3 janv. 2012, at 21:55, Gerhard Petracek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">hi,<div><br></div><div>i was going to suggest something similar.</div><div><br></div><div>we could provide a simple adapter interface with a method like:</div><div>&lt;T&gt; T resolveBean(Class&lt;T&gt; targetType)</div><div>

(and if we would like to support dependent beans, we should think about an additional dispose method.)</div><div><br></div><div>the only restriction is the manual usage of methods like ValidatorContext#messageInterpolator.</div>

<div>however, since it would be possible to configure those parts via a dependency injection container like cdi, it isn't a big issue.</div><div><br></div><div>regards,</div><div>gerhard</div><div><br></div><div><br>
</div>
<div><br><div class="gmail_quote">2012/1/3 Michael Nascimento <span dir="ltr">&lt;<a href="mailto:misterm@gmail.com">misterm@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>What about a different proposal: looking up the interface implementation using ServiceLoader? Then there would be nothing special about it.</p><p>Regards,<br>
Michael</p>
<div class="gmail_quote">On 3 Jan 2012 17:25, "Emmanuel Bernard" &lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt; wrote:<br type="attribution"></div>
<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>
<br></blockquote></div><br></div>
_______________________________________________<br>beanvalidation-dev mailing list<br><a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/beanvalidation-dev<br></blockquote></div><br></div></body></html>