commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut Bolčina <>
Subject Re: [Configuration] Wish list
Date Thu, 26 Jan 2006 12:07:05 GMT
Hello Oliver,

On 26.1.2006 12:09, Oliver Heger wrote:
> Hi,
> these are some good points. I plan some enhancements for 
> ConfigurationFactory and related classes and will take this into 
> account. Further comments below.
> Borut Bolčina wrote:
>> Hi,
>> I've been using Commons Configuration successfully in several 
>> projects. Besides XPath support I have 3 more feature wishes:
>> *[1] Getting Properties out of Configuration*
>> When using already written software components, some methods take 
>> Properties as input parameter. If using CompositeConfiguration as a 
>> central point for accesing properties, it would be desirable to get 
>> Properties out of PropertiesConfiguration which is part of 
>> CompositeConfiguration. Example of wanted functionality:
>> Configuration propertiesConfiguration = config.getConfiguration(2);
>> Properties properties = propertiesConfiguration.getProperties();
>> Asume 3rd entry in configuration.xml is <properties>.
> This one has been answered by Jörg.
...and already in my code :-)
>> *[2] Inclusion of DatabaseConfiguration in configuration.xml*
>> It woould be nice to introduce something like <database> tag in 
>> configuration.xml. The content of the tag would be connection string 
>> for the database. Example:
>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>> <configuration>
>>  <xml fileName="prop1.xml"/>
>>  <xml fileName="prop2.xml"/>
>>  <properties fileName=""/>
>>  <database 
>> connect="jdbc:mysql://"/>

>> </configuration>
> Of course, DatabaseConfiguration should be supported. In addition I 
> would like to have a mechanism for defining custom tags and including 
> user defined configuration classes.
When I work with (unknown) XML files, the first thing it comes to my 
mind is: "Is there a schema for it?". It really helps building XML files 
and preventing run time errors. I can make XML Schema for 
configuration.xml, and when consolidated with you and other developers, 
should be made available at some URL. Schema can be flexible about 
additional elements you are mentioning.
>> *[3] Getting configurations out of configuration.xml could be done by 
>> name and not by index.*
>> So, instead of
>> config.getConfiguration(2)
>> one could write
>> config.getConfiguration("entryThree");
>> A new attribute for each entry should be introduced, something like:
>> <configuration>
>>  <xml id="entryOne" fileName="prop1.xml"/>
>>  <xml id="entryTwo" fileName="prop2.xml"/>
>>  <properties id="entryThree" fileName=""/>
>>  <database id="entryFour" 
>> connect="jdbc:mysql://"/>

>> </configuration>
> This is a feature I have missed myself. Using the subset() method you 
> can access specific sets of properties, but sometimes you really need 
> access to the Configuration object, e.g. for changing some settings. I 
> will implement this.
Using subset() for my case is not applicable. I don't want to merge xml 
properties at some element. Feels like workaround, which is exactly what 
I want to avoid - that is why I chose Configuration to handle my 
properties as uniformly as possible. My code looks much nicer and is way 
shorter too!

One other thing. I plan to store 100.000 entries in database properties. 
Didn't measure the performance yet. Any comments on that?

> Oliver
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message