<div dir="ltr">Hi Marco,<div><br></div><div>Thanks for bringing up this proposal. I think it&#39;d be a good addition. Can you open a BVAL issue for it?</div><div><br></div><div>A variation could be to not stop after the first failure but after the first n, with n being a configurable number. I can&#39;t see a compelling use case for this, though. Usually you just want a quick exit if an object is invalid, so a binary setting should do it.</div><div><br></div><div>@Others, any thoughts from your side?</div><div><br></div><div>Cheers,</div><div><br></div><div>--Gunnar</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-29 7:38 GMT+02:00 Marco Molteni <span dir="ltr">&lt;<a href="mailto:moltenma@gmail.com" target="_blank">moltenma@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi guys,</div><div><br></div><div>What do you think about the &#39;promotion&#39; of fail-fast (from hibernate validator) to the BV API?</div><div><br></div><div>I see frequently this 2 use cases (in the 9-5 projects) to support the request ;)</div><div><br></div><div>1. batch: there are a lot of batch processes that have to validate the input data (flat file -&gt; bean -&gt; validation) and return for each bean only a technical error if at least one field is not valid (&#39;input refused&#39;). When there are millions (e.g. payments transactions) of beans to validate in a batch and 30-50 fields for each bean the fail-fast saves a lot of time (and the night is never long enough for all the batches required) ;)</div><div><br></div><div>2. REST response: in the validation of REST services often when 2 systems exchange data the answer in case of error is an HTTP 4xx without many details. The fail-fast is a time and machine resources saving when your application is accessed by (hundred of) thousand users through some external web client (e.g. JS client).</div><div><br></div><div>In the do-it-yourself implementations for the 2 uses cases at the first error an IllegalArgumentException is thrown with the information of the first error found.</div><div><br></div><div>The full test of every field is very well suited for uses cases in which there is a human to machine communication (e.g. web forms).</div><div><br></div><div>If your opinion is positive I can do more investigations if needed.</div><div><br></div><div>Cheers</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Marco</div></font></span></div>
<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></blockquote></div><br></div>