Henning P. Schmiedehausen wrote:

Yep. However, we could simply say, that for using this, you have to
have an URL. One can always fake up a Locator that loads the file from
the input stream, saves it to a temp file and returns this URL.

Yes that's a solution, alternatively the user can still call the load(InputStream) method.



new PropertiesConfiguration(locator.locate("config.properties));

I don't like that much. Once the locator has run, it has run. Passing the locator object allows the implementor to catch all the calls to locate() and maybe react differently.

I'm not sure to see the need, do you have a real use case in mind ?


How about wrapping the name of the configuration file / the
configuration parameters into the locator object:

config = new PropertiesConfiguration (new FileLocator("config.properties"));
config = new PropertiesConfiguration (new 
ClassPathLocator("config.properties"));

config.load(new FileLocator("config.properties"));

Hmm no because a locator is a strategy to find a resource, it doesn't define a resource, this is the role of the URL.



This would simplify the method signatures. We might even be able to
decouple things like JDBC and JNDI:

config = new PropertiesConfiguration(new JDBCLocator(... jdbc params...));

Is this really simpler than instanciating DatabaseConfiguration and JNDIConfiguration ? :)


Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to