[bv-dev] bv-dev] [BVAL-251] Improve Bean Validation support for modularized environments

Hardy Ferentschik hardy at hibernate.org
Tue May 15 04:51:29 EDT 2012


On May 15, 2012, at 10:42 AM, Emmanuel Bernard wrote:

>> If the application is made up of several modules, the activator of
>> some application module (having dependencies to all other modules and
>> thus seeing all their exported resources) should be in charge of
>> bootstrapping the factory.
> 
> Can you detail what you mean by that?
> Should the application developer write a module that will bootstrap Bean Validation? That the thing I want to avoid, having the user do useless heavy lifting.

I think this is what it all comes down to in a modular environment. Once upon a time I thought you would have one ValidatorFactory within a container and all
modules/apps. But due to class loading and encapsulation of modules/app you effectively need to create a ValidatorFactory for each module/app.

Is this not also what JBoss AS does? If you deploy an app using for example JPA as per J2EE spec Bean Validation gets enabled and a ValiatorFactory 
gets created. 

In the end it is up to the framework providers to make it as simple as possible to use Bean Validation for modules/apps running within the framework.
All Bean Validation needs to provide is a way to set the class loader.

--Hardy


More information about the beanvalidation-dev mailing list