[bv-dev] Should getters be considered methods during validation

Hardy Ferentschik hardy at hibernate.org
Fri Oct 26 20:17:47 EDT 2012





On 26 Oct 2012, at 19:31, Gunnar Morling <gunnar at hibernate.org> wrote:

> I think getters should be handled as any other methods during method validation.

+1

> Not considering them during method validation would IMO be some form
> irregularity, causing getter-named methods not to be validated
> although a user might expect it:

+1
>From the method validation point of view there is just no reason to treat getXYZ() differently. 
I rather have two validations of the same constraints happening, but I don't think it will be a big problem in most cases. 

A provider could always choose to make it configurable. 

--hardy





More information about the beanvalidation-dev mailing list