[bv-dev] Method validation - cont'd

Hardy Ferentschik hardy at hibernate.org
Tue May 15 06:05:17 EDT 2012


>>> * Further discuss @MethodValidated annotation with other EGs (e.g. JAX-RS)
>> 
>> What's about @ValidateContract, @ContractValidated or even just @Constract 
>> This get the "design by contract" idea in as well and it avoids the ambiguity when
>> it comes to constructors.
> 
> Naming wise, that's an interesting approach to use contract in the name.
> Another question we had with the JAX-RS team was whether or not such annotation would be mandatory
> to validate contracts by default.
> 
> In JPA and JSF, validation is on by default and I see no reason why JAX-RS would need to add a @ContractValidated 
> annotation to activate method-level validation. Of course the annotation would still be useful to customize
> validation and disable it altogether.

I agree that it should not be mandatory. 




More information about the beanvalidation-dev mailing list