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

Emmanuel Bernard emmanuel at hibernate.org
Tue May 15 05:03:24 EDT 2012


On 15 mai 2012, at 10:51, Hardy Ferentschik 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. 

s/J2EE/Java EE/

But that's the thing, this EG worked his butt off to make the Java EE integration 100% transparent for the application developer. And it was up to us
to achieve that and propose things to other EGs.

I am already not certain of what modularity gains you (as user), if on top of that the development model is subpar to what Java EE can offer, that would be a big drawback.

> 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.

Sure in the end, we will have a very simple ClassloaderService interface of sort, but I'd like to understand fully how that will be used to be sure things will be as good as possible
in a modular environment.


More information about the beanvalidation-dev mailing list