Hibernate validator already creates some metadata based on the validation annotations. However, currently this is used internally and no public access is provided. Since the implementation is already done in such a way, opening this metadata to external users can provide new possibilities like web application form validation. If a web developer can get validation metadata of a model object, then the form that binds to the object can support the same validation logic at the client side. This way, server side validation rules would not be replicated at the client side, consistency would be assured and more important, automatic form generation ( scaffolding ) would be much easier. Although this may not be very helpful for very complex conditional validation scenarios, most of the time web forms are simpler and even for a complex form, field rules like null checks, empty checks, and regex checks are enough to save real effort. I know that this feature is not relevant to the spec, but if Hibernate validator supports this, then it would be very beneficial for web frameworks like Spring MVC which by default has Hibernate Validator integration can provide better client side validation support. |