[bv-dev] BVAL-292 / BVAL-293 ConfigurationSource rename and behavior clarification

Gunnar Morling gunnar at hibernate.org
Mon Jul 23 03:14:03 EDT 2012


Am 18.07.2012 11:32 schrieb "Hardy Ferentschik" <hardy at hibernate.org>:
>
>
> On Jul 17, 2012, at 10:42 PM, Gunnar Morling wrote:
>
> >> Initially I thought about using DefaultConfiguration as an alternative
name, but as Emmanuel pointed out in an earlier email it clashes to a
certain degree with the programmatic Configuration interface.
> >
> > But does it really clash? IMO Configuration provides a unified way for
> > accessing the effective configuration. It allows to change the
> > configuration in a programmatic way but it could also provide a handle
> > to the default configuration from validation.xml via
> > getDefaultConfiguration().
> >
> > I see there is a clash with getDefaultMessageInterpolator() etc,
> > though (which returns the default implementations as demanded by the
> > spec.), so maybe the method returning the user provided default
> > configuration should be named getExternalDefaultConfiguration(),
> > getBootstrapDefaultConfiguration() or similar.
>
> That's exactly the clash I am talking about. If we call it
_DefaultConfiguration_ and just call the getter
> Configuration#getDefaultConfiguration we have for example
Configuration#getDefaultMessageInterpolator, but
> also
Configuration#getDefaultConfiguration()#getMessageInterpolatorClassName.
IMO that can be misleading.

I see, yes that's definitely sub-optimal.

>
> One way to avoid this would be to call the accessor
#getExternalDefaultConfiguration() or #getBootstrapDefaultConfiguration()
> as you suggest, but then I rather call it BootstrapConfiguration to begin
with.
>

Works both for me.

> I chose XMLConfiguration, because I think it is ok to limit this method
to validation.xml. If we really want to keep
> "doors open" I could imagine renaming to BootstrapConfiguration.

+1 Personally, for me the “naming things by semantics“ argument is even
more important than leaving doors open. We would just get the latter for
free by following the former.

>
> What do others think?

Yepp, please speak up guys :) Let's bring this to an end.

>
> --Hardy

--Gunnar

> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20120723/226ada5c/attachment.html 


More information about the beanvalidation-dev mailing list