You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Tim O'Brien <to...@discursive.com> on 2004/06/13 22:35:56 UTC
[configuration] PropertiesConfiguration vs. DOM.*Configuration
DOM4JConfiguration and DOMConfiguration each have two constructors which
take a parameter. One takes a File and the other takes a resource name as a
String.
PropertiesConfiguration has one constructor which takes a parameter, and it
is a String representing a file name.
Anyone have any objections to bringing PropertiesConfiguration into sync
with the two XMLConfiguration implementations? In other words,
PropertiesConfiguration should have a constructor which takes a File and a
constructor which takes a String resource name.
Alternatively, why not have all Configuration implementations just take a
Reader?
Tim
RE: [configuration] PropertiesConfiguration vs. DOM.*Configuration
Posted by Tim O'Brien <to...@discursive.com>.
> -----Original Message-----
> From: Emmanuel Bourg [mailto:ebourg@micropole-univers.com]
> Sent: Monday, June 14, 2004 10:27 AM
> To: Jakarta Commons Developers List
> Subject: Re: [configuration] PropertiesConfiguration vs.
> DOM.*Configuration
>
> Tim O'Brien wrote:
>
> > Alternatively, why not have all Configuration implementations just
> > take a Reader?
>
> And drop the File/filename constructors ? How would we save
> the configurations, with a save(Writer) method ?
>
On second thought, I don't necessarily think that we should change the
approach to the *Configuration object this drastically. I think changing
PropertiesConfiguration to take both a File and a String for a resource is a
better first step.
> Emmanuel Bourg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [configuration] PropertiesConfiguration vs. DOM.*Configuration
Posted by Emmanuel Bourg <eb...@micropole-univers.com>.
Tim O'Brien wrote:
> Anyone have any objections to bringing PropertiesConfiguration into sync
> with the two XMLConfiguration implementations? In other words,
> PropertiesConfiguration should have a constructor which takes a File and a
> constructor which takes a String resource name.
Sure, that sounds reasonable.
> Alternatively, why not have all Configuration implementations just take a
> Reader?
And drop the File/filename constructors ? How would we save the
configurations, with a save(Writer) method ?
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [configuration] PropertiesConfiguration vs. DOM.*Configuration
Posted by Oliver Heger <he...@med.uni-marburg.de>.
Of course the API should be consistent, so I am +1 for the proposed changes.
Using a Reader or an InputStream might not be sufficient in all cases,
especially for the XML configurations. Then the XML parser would have
trouble resolving external entities.
There were suggestions to introduce a generic mechanism to find
configuration files, a kind of Locator interface with different
implementations for retrieving data from the file system, the classpath
or whatever. I think after the 1.0 release we will go in this direction.
Oliver
Tim O'Brien schrieb:
> DOM4JConfiguration and DOMConfiguration each have two constructors which
> take a parameter. One takes a File and the other takes a resource name as a
> String.
>
> PropertiesConfiguration has one constructor which takes a parameter, and it
> is a String representing a file name.
>
> Anyone have any objections to bringing PropertiesConfiguration into sync
> with the two XMLConfiguration implementations? In other words,
> PropertiesConfiguration should have a constructor which takes a File and a
> constructor which takes a String resource name.
>
> Alternatively, why not have all Configuration implementations just take a
> Reader?
>
> Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org