commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <>
Subject Re: [configuration] Accessing from EL script
Date Wed, 19 May 2004 14:16:55 GMT

Oliver Heger wrote:

> Hierarchical configurations would provide such a hierarchical context 
> mentioned in this thread. But wouldn't there be ambiguities?
> Imagine you have a configuration containing the properties foo=something 
> and If you now want to access 
> ${} and 
> ${}, how could an implementation 
> know whether foo means a context or a property value?
> Oliver

That is a good point, one posibility would be to have some simple 
precidence rules that when tracing the substrings of a property name.

If it resolves to a fully qualified object in the properties, then 
return it, otherwise, if any substrings match return a set of those 
substrings matching it.

For instance, storing :

config.add("a.b", z);
config.add("a.b.c", y);
config.add("a.b.c.d.e", x);
config.add("a.b.c.d.e.f", w);

${sessionScope.configAttribute.a.b} --> z
${sessionScope.configAttribute.a.b.c} --> y
${sessionScope.configAttribute.a.b.c.d.e} --> x
${sessionScope.configAttribute.a.b.c.d.e.f} --> w


    --> Map containing {"e",x; "e.f",w}

I'm sure there are other cases to take into consideration too.

> Emmanuel Bourg schrieb:
>> Mark R. Diggory wrote:
>>> Hmm, I'm not sure your getting me, I'm refering to making the 
>>> Configuration interface a proper Map via an extension of the 
>>> Collection API's Map Interface and requiring all implementations to 
>>> support that interface (Which could be facilitated through 
>>> Abstraction/Polymorphism) with little impact to the existing usage.
>> I have been supporting the idea of basing the Configuration interface 
>> on java.util.Map for quite some time, that's why I filed Bug 26102 to 
>> start the convergence of the 2 interfaces but there was no urgent need 
>> to implement the Map interface. This EL use case is an interesting 
>> argument to push toward this change, but I'm not sure it will work 
>> well once we address the issue of hierarchical configurations.
>> Emmanuel Bourg
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

Mark Diggory
Software Developer
Harvard MIT Data Center

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message