[bv-dev] Promote fail fast?

Marco Molteni moltenma at gmail.com
Mon Aug 29 01:38:59 EDT 2016


Hi guys,

What do you think about the 'promotion' of fail-fast (from hibernate
validator) to the BV API?

I see frequently this 2 use cases (in the 9-5 projects) to support the
request ;)

1. batch: there are a lot of batch processes that have to validate the
input data (flat file -> bean -> validation) and return for each bean only
a technical error if at least one field is not valid ('input refused').
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) ;)

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).

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.

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).

If your opinion is positive I can do more investigations if needed.

Cheers

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


More information about the beanvalidation-dev mailing list