Currently the configuration of the server is handled in
ContextListener.java, this class uses Apache commons-configuration,
specifically, PropertiesConfiguration to load the settings and then
save them in the servlet context as "properties"

I have some concerns about  using PropertiesConfiguration here. I
don't see any use of the persistence provided by this class and I
don't see any use of the data type handling of the
PropertiesConfiguration class. So I wonder if it is necessary to use
this class rather than a bog standard properties class?

What worries me is that if there were, at some point in the future, a
use of the persistance mechanisms it would be storing settings in a
file that would be overwritten if a server were upgraded because it is
currently written to widgetserver.properties in the classpath, a file
which is provided in the source tree. We cannot expect future
developers to notice this problem and we will therefore cause a bit of
a headache for them.

I'm working on the ability to override properties in a local file and
propose to solve the above problem at the same time with a bit of
refactoring. I propose to change the way config properties are handled
as follows:

- load $CLASSPATH/widgetserver.properties into a non-persistance
configuration object.
- seed a PropertiesConfiguration class with these values
- load System.getProperty("user.dir")/local.widgetserver.properties
into the config (creating file if necessary)
- proceed with current implementation

This means behaviour of the properties system will not change once the
initial values are written, but if anyone changes and saves a property
in the future it will be stored in a local file not a classpath file.

Have I missed anything important (will assume lazy consensus on this one).

Ross



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk

Reply via email to