[bv-dev] BV 2.0 - Add constraints?

Marco Molteni moltenma at gmail.com
Tue Aug 23 11:49:44 EDT 2016


Hi Gunnar,

Here the procedure to find the result:

1. Quick and dirty

copy this url and rellace the class name in the result page

https://github.com/search?l=&q=javax.validation.constraints.NotNull+language%3AJava&ref=advsearch&type=Code&utf8=%E2%9C%93


2. Step by step

You can go here:

https://github.com/search/advanced

You should search the full class name of the annotation, ex. :
javax.validation.constraints.NotNull

You can set the language to Java. After you execute the query you can
filter only the results in 'Code'.

Like this you can find where an annotation class is imported.


Remarks:

At every execution the result change 5-10%, it's absolutely not scientific
(I don't know how it works their index and search) but you can get an idea
of the usage of some classes.


Cheers,

Marco

On Tue, Aug 23, 2016 at 12:15 PM, Gunnar Morling <gunnar at hibernate.org>
wrote:

> Hi Marco,
>
> Nice research! Out of curiosity, how did you get these numbers?
>
> Historically, the spec stayed on the conservative end in terms of built-in
> constraints. @NotEmpty etc. can quite easily be implemented or even just be
> composed based on other built-in constraints. But the numbers you shared
> indeed indicate some usefulness of adding at least some.
>
> Would be interesting to know what others think?
>
> Cheers,
>
> --Gunnar
>
>
>
>
> 2016-08-22 20:32 GMT+02:00 Hendrik Ebbers <hendrik.ebbers at me.com>:
>
>> +1
>>
>> Am 22.08.2016 um 19:37 schrieb Marco Molteni <moltenma at gmail.com>:
>>
>> Hi all,
>>
>> It would be possible to add some built-in constraints to the V 2.0?
>>
>> @NotBlank, @NotEmpty, @Length are used very often in projects, they are
>> already present in Hibernate Validator and their implementation is well
>> defined.
>>
>> What do you think?
>>
>> Here a list of the most used constraint for GitHub's projects (the
>> numbers change at every request but you get the idea. HV = Hibernate
>> Validator, BV = Bean Validation):
>>
>> 189'143 - BV - NotNull
>>  56'902 - BV - Size
>>  39'551 - HV - NotEmpty <-
>>  20'687 - HV - NotBlank <-
>>  17'735 - BV - Pattern
>>  16'763 - HV - Email
>>  16'033 - BV - Min
>>  12'769 - HV - Length <-
>>   7'806 - BV - Digits
>>   4'982 - BV - Max
>>   4'971 - BV - Past
>>   3'598 - BV - DecimalMin
>>   2'753 - BV - AssertTrue
>>   2'379 - BV - DecimalMax
>>   2'308 - BV - Future
>>   1'999 - HV - Range
>>   1'497 - HV - URL
>> < 1'000 other constraints
>>
>> Thanks
>>
>> Cheers
>>
>> Marco
>> _______________________________________________
>> beanvalidation-dev mailing list
>> beanvalidation-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
>>
>>
>>
>> _______________________________________________
>> beanvalidation-dev mailing list
>> beanvalidation-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
>>
>
>
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20160823/b97ba63f/attachment.html 


More information about the beanvalidation-dev mailing list