[bv-dev] Cross parameter validation convergence

Emmanuel Bernard emmanuel at hibernate.org
Thu Sep 6 09:05:09 EDT 2012


On Jeu 2012-09-06 14:54, Hardy Ferentschik wrote:
> 
> On 6 Jan 2012, at 2:49 PM, Emmanuel Bernard wrote:
> 
> > On Mer 2012-09-05  9:51, Gunnar Morling wrote:
> >>>> If we really want to add this to BV 1.1, IMO we should only add the
> >>>> generic approach and let implementors experiment with the type-safe
> >>>> one.
> >>> 
> >>> What is your reasoning for not wanting the type safe approach in?
> >> 
> >> It's just the number of open questions around this which I'm a bit
> >> concerned about. For the other method validation things we could more or
> >> less rely on the experiences from the existing implementations or added
> >> smaller things like ParameterNameProvider.
> >> 
> >> Compared to that, there are several questions around (type-safe)
> >> cross-parameter validation we'd be answering in the spec for the first
> >> time. But it may be I'm just over-cautious here.
> > 
> > That is a legitimate fear but, I'd rather we give all that we've got and
> > try to build the feature even if we decide to pull it out in the last
> > month before the release.
> > 
> > My reasoning is that we will have see the option(s) we have for the
> > future and won't cut us into a corner.
> 
> I still don't understand why we not just go for the generic approach and leave the type-safe 
> approach out for now. This seems to me the safest alternative for me atm.
> 
> As we discussed only the generic approach allows for all possible cross parameter validation
> scenarios. For this reason we want to add it either way. Why complicating things with adding
> another approach with the risk of being too ambitious. 

My reasoning is explained in the part of the email you have quoted but
let me clarify it. We might decide that it is not fleshed out or too
complicated for the added safety in the end to be worth it. But until
we try and design it, we cannot decide.

In the last week we have made a lot of progress on what a type-safe
approach should and should not be and what rules would need to be
enforced. I'd like to pursue that effort.

Worse case, we already have figured out that we need to be very careful
about the interface name `CrossParametersConstraintValidator` to amke
sure we leave room for a type-safe sister.


More information about the beanvalidation-dev mailing list