|
Hey Chris,
Thanks for taking the initiative and having a looking into this!
When the "rules" Set is built it would add or not add some instances depending on configuration. Does that sound reasonable so far?
Yepp, that sounds right.
and maybe a stupid question but is there any easy way to get to the ConfigurationImpl? It seems like I'd have to pass configuration properties along on the stack (like failfast is done), which will make for some long parameter lists eventually.
Adding configuration options is indeed a bit tedious as it requires changes to quite a few places. But taking failFast as example is a very good strategy. The option would have to be added to HibernateValidatorConfiguration (for setting it on the factory level) and HibernateValidatorConfiguration (for setting it for single validators). I'd then pass the single option from ValidatorFactoryImpl to BeanMetadataManager to BeanMetaDataBuilder.
Regarding the long parameter lists, I think it's still ok, but we might consider to introduce some kind of parameter objects in some places. The basic problem is that we don't have any service registry or DI mechanism in Hibernate Validator, which requires all dependencies to be passed along the stack when creating objects such as metadata manager or builders.
Hth,
--Gunnar
|