You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Jeremias Maerki <je...@outline.ch> on 2001/09/19 10:28:38 UTC
Difference between Configurable and Parameterizable
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.
Cheers,
OUTLINE AG
Jeremias Märki
mailto:jeremias.maerki@outline.ch
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: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: Difference between Configurable and Parameterizable
Posted by Jeremias Maerki <je...@outline.ch>.
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:jeremias.maerki@outline.ch
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: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: Difference between Configurable and Parameterizable
Posted by Peter Donald <do...@apache.org>.
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 ? ;)
--
Cheers,
Pete
-----------------------------------------------------------
"Remember, your body is a temple; however, it's also your
dancehall and bowling alley" -- Dharma Montgomery
-----------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: Difference between Configurable and Parameterizable
Posted by Berin Loritsch <bl...@apache.org>.
Jeremias Maerki wrote:
>
> Thank you, Berin.
>
> So, the two interfaces are just two different ways of configuring an
> Avalon-aware object. One can live without the other.
Exactly.
> On Wed, 19 Sep 2001 08:38:18 -0400 Berin Loritsch wrote:
> > 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.
> >
> > True. The difference is when all you need is a flat configuration scheme
> > as opposed to a hierarchical one.
> >
> > Parameters is much like Properties with the exception of type safety built
> > in. It is a flat configuration scheme--easily derived from a heirarchical
> > one.
> >
> > Configuration is for when your Configuration elements need to be expressed
> > in a more rich manner. It allows you to group sub configurations together
> > very easily.
> >
> >
> > As far as the overall weight of the objects, the Parameters object is lighter
> > than the Configuration object.
>
> Cheers,
> Jeremias Märki
>
> mailto:jeremias.maerki@outline.ch
>
> 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: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: Difference between Configurable and Parameterizable
Posted by Jeremias Maerki <je...@outline.ch>.
Thank you, Berin.
So, the two interfaces are just two different ways of configuring an
Avalon-aware object. One can live without the other.
On Wed, 19 Sep 2001 08:38:18 -0400 Berin Loritsch wrote:
> 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.
>
> True. The difference is when all you need is a flat configuration scheme
> as opposed to a hierarchical one.
>
> Parameters is much like Properties with the exception of type safety built
> in. It is a flat configuration scheme--easily derived from a heirarchical
> one.
>
> Configuration is for when your Configuration elements need to be expressed
> in a more rich manner. It allows you to group sub configurations together
> very easily.
>
>
> As far as the overall weight of the objects, the Parameters object is lighter
> than the Configuration object.
Cheers,
Jeremias Märki
mailto:jeremias.maerki@outline.ch
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: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
Re: Difference between Configurable and Parameterizable
Posted by Berin Loritsch <bl...@apache.org>.
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.
True. The difference is when all you need is a flat configuration scheme
as opposed to a hierarchical one.
Parameters is much like Properties with the exception of type safety built
in. It is a flat configuration scheme--easily derived from a heirarchical
one.
Configuration is for when your Configuration elements need to be expressed
in a more rich manner. It allows you to group sub configurations together
very easily.
As far as the overall weight of the objects, the Parameters object is lighter
than the Configuration object.
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org