You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ola Berg <ol...@arkitema.se> on 2002/06/13 10:12:28 UTC

Re: [Configuration] Proposals

Interesting.

I have a config-framework myself, and lacks some of the kind of features that you listed.

The features that I have in mine includes:

Bean-driven: sub packages in the system simply throws empty beans into the configuration framework. The config framework populates the bean from the configuration data. So if you have a bean with the following properties:

class LoggerConfig{
  public void setLogFile( File f)...
  public void setTimeOutMinutes( int t)...
}

...that bean, when thrown at the configuration framework will be populated, given that the config file (for now, only properties-files are supported) contains:

logFile=/foo/bar/log.txt
timeOutMinutes=5

My converter framework (not merged with apaches yet) instantiates the File object and the int value and sets the properties.

This even works recursively, so if you have another subpackage that needs

class FooBarConfig{
  public void setStartUrl( URL url)...
}

...you can integrate them in an outer bean:

class SystemConfig {
  public void setLogger( LoggerConfig l)...
  public void setFooBar( FooBarConfig f)...
}

...and the properties file can look like this:

logger.logFile=/foo/bar/log.txt
logger.timeOutMinutes=5
fooBar.startUrl=http://www.apache.org



Integrated with a factory framework and a pool: Since there is a lot of dynamic instantiation that takes place within the framework, there is the possibility for the configuration framework to wait, not instantiating anything until needed. And the factory framework is integrated with the pool.

Feature next to be implemented is the update feature: the configurator keeps a reference to all the object it has populated. Given a notice that some data has changed, the data will be changed. So as long as the sub systems keeps a reference to the config bean, and grabs the value from there, whenever it is needed, automatic reconfig at runtime is supported. 

It seems like these features could be merged with yours and existing features.

/O

--------------------
ola.berg@arkitema.se
0733 - 99 99 17

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>