[bv-dev] Questions from BV spec 2.0 public draft

Guillaume Smet guillaume.smet at gmail.com
Wed Apr 26 05:12:19 EDT 2017


On Wed, Apr 26, 2017 at 10:40 AM, Gunnar Morling <gunnar at hibernate.org>

> > * Should there be a common superinterface for
> > Path$[BeanNode|PropertyNode|ContainerElementNode], all of which define
> > the same methods?
> I've been wondering the same, but come to think that it doesn't give you
> much.
> You (as a user) are going to work with specific node types (as
> narrowed down via getKind() + as()), so I would not expect you to deal
> with that super-type in your code. It'd put the declaration of those
> methods into one place, which is nice, though I kinda like the
> simplicity of the current Node hierarchy, with one specific sub-type
> per kind.
> What do others think?

I had the exact same reasoning when I did it.

> * Should Positive/Negative#strict() default true be provided as
> > #orZero() default false, for commonality with
> > [Past|Future]#orPresent() ?
> Hum, yes, good point. I think I'd prefer that.
> @Emmanuel, I vaguely remember we discussed this. Did you see a good
> reason for the current default?
> @All, what do you think?

Matt, do you just want to change the name or also to change the default?

Currently, it's:
boolean strict() default false;
and you are supposing the default is true in your question.

Currently, we have:
- Positive/Negative: strict() default false;
- DecimalMin/DecimalMax: inclusive() default true;
- Past/Present: orPresent() default false;

I thought about proposing orZero() at the time but I didn't suggest it
because "strictly positive" makes sense.

Being strict by default would probably make more sense.

As for the name, I'm torn.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20170426/7eb7e108/attachment.html 

More information about the beanvalidation-dev mailing list