On Wed, 19 Sep 2001 20:23:00 +1000 Peter Donald wrote:
> On Wed, 19 Sep 2001 18:28, Jeremias Maerki wrote:
> > Hi there
> >
> > After looking through the documentation and the mailing list archives I
> > still don't know why there are two interfaces Configurable and
> > Parameterizable. I've seen some mails from April when Parameterizable
> > was introduced, but that didn't help. Also, the API docs simply state
> > that the two interfaces are incompatible. I currently believe
> > Parameterizable isn't needed, because I can do all
> > configuration/parameterization I need using Configurable.
> >
> > Would someone be so kind as to explain to me the differences and relieve
> > me of my confusion? Many thanks in advance.
>
> Well they really serve different purposes. Parameters supply "flat"
> configuration data and can be considered to be like simplified
> property files with extra type safe utility methods.
>
> Configuration objects supply "hierarchial" configuration data and can be
> considered as simplified XML style configurations with extra type-safe
> utility methods.
>
> In most cases, Configuration is acceptable but there is cases where
> Parameters are a better choice to configure the system (usually when the
> configuration data is naturally flat). For instance I quite often use
> Parameters to represent config data passed in via Command Line arguments.
>
> I also use it to contain names of classes implementing an interface. So say
> if I had pluggable components in my application that implemented interfaces
>
> com.biz.A, com.biz.B and com.biz.C
>
> then it is useful to have Parameter object map them to implementation
> instances. ie
>
> com.biz.A=com.biz.AImpl
> com.biz.B=com.biz.BImpl
> com.biz.C=com.biz.CImpl
>
> And if I want to change the implementing class I just change a swith on CLI
> or in proeprties file and voila. In these cases XML-style config data is
> often clumsy and heavy-weight.
>
> Does that make any sense ? ;)
Yes, it does. Thanks for pointing this out.
Cheers,
Jeremias M�rki
mailto:[EMAIL PROTECTED]
OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]