jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Groen <roland.gr...@gmail.com>
Subject JCS configuration flexibility
Date Thu, 20 Jan 2005 10:47:44 GMT
I want to use JCS in one of our projects, but there is one annoying
issue: why does JCS need a configuration file format while it
internally uses a java.util.Properties instance. Why do I need to
create a file wile I can configure JCS using my own configuration
format and just pass on a Properties instance to the init process?

Configuration of a library as JSC should, of course, be supported by
passing a configuration file path, but there should be an option to
just configure it from the code eg. by instantiating and passing some
kind of configuration object. In this case an instance of Properties.

I always attempt to use one and only one xml configuration file for
for each project/application. It's confusing to have a million
different files with different syntaxes hanging around in a project.
For libraries, I always provide a configuration object which is passed
to the service/library and provide a builder architecture which builds
the configuration object from a specific source, usually an xml

Element myConfigElement = ....
FooBuilder myBuilder = new XmlFooBuilder(myConfigElement);


String myConfigFilePath = ....
FooBuilder myBuilder = new PropsFooBuilder(myConfigFilePath);

and than:

FooConfig myFooConfig = myBuilder.build();
Foo myFoo = new Foo(myFooConfig);

This way the configuration of different libraries can be composed in
one xml file for each application. Clean and simple. Want it your own
way? Make your own builder...

For now it would be nice just to be able to pass an instance of
Properties to the JCS class:

public static void setConfigProperties(Properties configProperties)



To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org

View raw message