You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Emmanuel Bourg <eb...@micropole-univers.com> on 2004/03/30 16:43:56 UTC
[configuration] Flattening trees
Hi, last week I started playing with the Preferences API and a Windows
configuration manipulating the registry through JNI. I had not
experimented with hierarchical configurations before, this led me to a
dumb question : what are we supposed to do when a key contains a dot ?
Should we search the value in the sub nodes or get the first property in
the current node matching the key ? This issue can be illustrated with
the following XML configuration:
<a>
<b>
<c>value1</c>
</b>
<b.c>value2</b.c>
</a>
What's the key "a.b.c" supposed to return ? "value1" ? "value2" ? Or an
array with both ?
A lot of configurations have a hierarchical structure : LDAP, JNDI, the
windows registry, INI files (a tree a depth 1), XML files, the Avalon
configuration API, the JDK 1.4 Preferences API. That makes me wonder if
we aren't on the wrong track for a generic configuration API,
[configuration] is Properties centric for historical reasons, should we
keep trying to flatten hierarchical structures and make them look like a
.properties file ? Should we change the Configuration interface to
support hierarchical structures directly (and turn
PropertiesConfiguration into a tree) ? Should we support both separately
with an XPath like syntax to unify the keys ?
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org