<div dir="ltr">Hi Gunnar,<div><br></div><div>I will open a BVAL issue. Interesting the n option, but I didn't find any concrete use case neither. As you said, usually the result expected is true or false.</div><div><br></div><div>Cheers</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 30, 2016 at 10:42 AM, Emmanuel Bernard <span dir="ltr"><<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't think a n option would make sense.<br>
One that might make sense is to keep validating a failing field with the<br>
remaining constraints before stopping to at least have a comprehensive<br>
view of the failure especially when constraints are composed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Emmanuel<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue 2016-08-30 8:48, Gunnar Morling wrote:<br>
> Hi Marco,<br>
><br>
> Thanks for bringing up this proposal. I think it'd be a good addition. Can<br>
> you open a BVAL issue for it?<br>
><br>
> A variation could be to not stop after the first failure but after the<br>
> first n, with n being a configurable number. I can't see a compelling use<br>
> case for this, though. Usually you just want a quick exit if an object is<br>
> invalid, so a binary setting should do it.<br>
><br>
> @Others, any thoughts from your side?<br>
><br>
> Cheers,<br>
><br>
> --Gunnar<br>
><br>
><br>
> 2016-08-29 7:38 GMT+02:00 Marco Molteni <<a href="mailto:moltenma@gmail.com">moltenma@gmail.com</a>>:<br>
><br>
> > Hi guys,<br>
> ><br>
> > What do you think about the 'promotion' of fail-fast (from hibernate<br>
> > validator) to the BV API?<br>
> ><br>
> > I see frequently this 2 use cases (in the 9-5 projects) to support the<br>
> > request ;)<br>
> ><br>
> > 1. batch: there are a lot of batch processes that have to validate the<br>
> > input data (flat file -> bean -> validation) and return for each bean only<br>
> > a technical error if at least one field is not valid ('input refused').<br>
> > When there are millions (e.g. payments transactions) of beans to validate<br>
> > in a batch and 30-50 fields for each bean the fail-fast saves a lot of time<br>
> > (and the night is never long enough for all the batches required) ;)<br>
> ><br>
> > 2. REST response: in the validation of REST services often when 2 systems<br>
> > exchange data the answer in case of error is an HTTP 4xx without many<br>
> > details. The fail-fast is a time and machine resources saving when your<br>
> > application is accessed by (hundred of) thousand users through some<br>
> > external web client (e.g. JS client).<br>
> ><br>
> > In the do-it-yourself implementations for the 2 uses cases at the first<br>
> > error an IllegalArgumentException is thrown with the information of the<br>
> > first error found.<br>
> ><br>
> > The full test of every field is very well suited for uses cases in which<br>
> > there is a human to machine communication (e.g. web forms).<br>
> ><br>
> > If your opinion is positive I can do more investigations if needed.<br>
> ><br>
> > Cheers<br>
> ><br>
> > Marco<br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > beanvalidation-dev mailing list<br>
> > <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
> ><br>
<br>
> ______________________________<wbr>_________________<br>
> beanvalidation-dev mailing list<br>
> <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
<br>
______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
</div></div></blockquote></div><br></div>