Emmanuel Bourg <[EMAIL PROTECTED]> writes:
>Henning P. Schmiedehausen wrote:
>> I don't think, this is overengineered. Are you sure about URL locate?
>> I'd probably go for InputStream locate().
>Is that for classloaders that do no support getRessource ? We really
>need to know where the file is located in order to reload it efficiently.
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.
>> Hm. I probably would like this solution better than the current (which
>> reminds me of the way that commons-logging tries to find its log
>> APIs). We could use current as the default and make the others
>> pluggable. (and add a few C'tors which accept a Locator object)
>We could either keep the current constructors and use the Locator directly :
>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.
>or add one constructor :
>new PropertiesConfiguration("config.properties", locator);
>in this case we'll also need another load method :
>config.load("config.properties", locator);
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"));
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...));
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
[EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/
RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire
Linux, Java, perl, Solaris -- Consulting, Training, Development
What is more important to you...
[ ] Product Security
or [ ] Quality of Sales and Marketing Support
-- actual question from a Microsoft customer survey
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]