If we have Loccators, IMO there is no need to keep the base path and file name stuff in file based configurations. These are things a concrete Locator has to deal with, and the information needed by a Locator may vary. So I suggest the following simple method signature:

   URL locate();  // eventuelly throws ConfigurationException?

Concrete Locators should have getter and setter methods for the properties they need, e.g. the ClasspathLocator a resource name, the URLLocator a URL etc. That way a Locator could be created by Digester and initialized with a SetPropertiesRule, which comes in handy when used with ConfigurationFactory.

Usage of a Locator would then look like:
Locator locator = new MyConcreteLocator();
// init locator as necessary
Configuration conf = new PropertiesConfiguration(locator);

in contrast to
Locator locator = new MyConcreteLocator();
Configuration conf = new PropertiesConfiguration();
conf.setBasePath(...);
conf.setFileName(...);
conf.load(locator);

Oliver


Emmanuel Bourg wrote:

Here is a quick attempt at implementing the Locator strategy discussed earlier. Feel free to comment :)

Emmanuel Bourg



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



Reply via email to