Cool! I have been waiting for this for many a long moon! I think caching should be done as a decorator, that way you can have multiple strategies for caching, and can use them across multiple types of configuration objects.
The code looks very clean, I love having AbstractConfiguration. Having the DBUnit/HSQLDB unit test is excellent, I really appreciate that. Have you thought about tossing in a unit test demonstrating using it with a compositeConfiguration? Also, I know the next thing is going to be using it with ConfigurationFactory, and defining the parameters in the configuration.xml file. This does bring up a different issue: How do we create an easy to extend test suite? We need something where we can rapidly create a new unit test that tests a XXXConfiguration with a ConfigurationFactory, a CompositeConfiguration, and, as we add decorators, test it across the varous decorators. Otherwise I fear that in 6 months, we will have many different XXXConfigurations, that all have subtlely (sp?) different interactions with each other... Of course, maybe that means with need more functional versus unit test tests. Eric Pugh > -----Original Message----- > From: Emmanuel Bourg [mailto:[EMAIL PROTECTED] > Sent: Saturday, January 17, 2004 7:48 PM > To: Jakarta Commons Developers List > Subject: [configuration] DatabaseConfiguration > > > I have written a configuration implementation that uses a database to > store the properties. It supports 2 table structures : > - one table per configuration (2 colums key/value) > - one table for multiple configurations (2 columns key/value > + 1 column > for the name of the configuration) > > The names of the tables and columns are specified in the constructor, > for example : > > Configuration config = new DatabaseConfiguration(datasource, > "configuration", "key", "value"); > > There is no caching mechanism, I wonder if it should be > implemented into > the class or separately as a decorator. > > Comments are welcome :) > > Emmanuel Bourg > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
