You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/12/29 23:02:07 UTC

DO NOT REPLY [Bug 38075] New: - [configuration] add new config.subsets() method to return multiple SubsetConfigurationS

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38075

           Summary: [configuration] add new config.subsets() method to
                    return multiple SubsetConfigurationS
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: hoju@visi.com


Please consider adding a configuration.subsets(String) method to return a list
of subset configurations that match the string query.  This corresponds to the
configuration.subset(String) method that returns a single SubsetConfiguration. 
I mentioned this in a thread on the user list [1].  I hope it can be added in
short order.  I'm not sure whether returning a List or an Iterator would be
best?  In any case, I would use it like this (assuming, for now, that it returns
a list)...

List subConfigs = config.subsets("tables.table");
for (Iterator iter = subConfigs.iterator(); iter.hasNext();) {
    SubsetConfiguration subConfig = (SubsetConfiguration) iter.next();
}

...where if I was only trying to get one subset configuration at a time, I 
might do...

SubsetConfiguration subConfig = (SubsetConfiguration)
config.subset("tables.table(0)");

Of course, I always use the subset configuration in the context of a
loop/iteration, since I need to deal with all of them (and where there may be
any number "tables.table" entries in the XML), not just one at a time leading to
the rather ugly while loop example I resorted to in the thread I referenced. 
Does this seem reasonable to add to the next release?

[1] - http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=113528247017087&w=2


Jake

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38075] - [configuration] add new config.subsets() method to return multiple SubsetConfigurationS

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38075





------- Additional Comments From oliver.heger@t-online.de  2006-01-19 21:35 -------
Yes, this sounds reasonable.

When working on the refactoring of the internal node structures used by
HierarchicalConfiguration I had the idea of a different Configuration class,
which is very similar to SubsetConfiguration, but more light weight.

The subset() method in HierarchicalConfiguration as it is implemented ATM is not
really efficient because it involves copying of whole sub trees. For the special
case that the subset contains only a single node (which would be the case for
this use case: a list of subset configurations, each of which represents one
configuration node), a specialized SubnodeConfiguration could be used. This
class would wrap a (sub) node of a parent configuration and would perform all of
its operations directly on this node and its children. So manipulations at the
SubnodeConfiguration or its parent would directly be visible to each other.

I will do some experiments with this idea. But whatever the outcome is, this
feature request in any case makes sense.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38075] - [configuration] add new config.subsets() method to return multiple SubsetConfigurationS

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38075


oliver.heger@t-online.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38075] - [configuration] add new config.subsets() method to return multiple SubsetConfigurationS

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38075


oliver.heger@t-online.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From oliver.heger@t-online.de  2006-01-22 20:32 -------
I have implemented a method that returns a list of sub configurations and that
should do what you want.

This method makes use of a new SubnodeConfiguration class that directly operates
on  a node of another HierarchicalConfiguration. So constructing such objects is
quite efficient, which makes them better suited for this particular use case.

HierarchicalConfiguration now defines two methods:
- configurationAt() returns a SubnodeConfiguration for a single selected node
- configurationsAt() returns a list of SubnodeConfiguration objects for all
nodes selected by the passed in key; this is the method of choice for your use case.

I also updated the XML howtos to document these new methods.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38075] - [configuration] add new config.subsets() method to return multiple SubsetConfigurationS

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38075





------- Additional Comments From hoju@visi.com  2006-01-23 05:44 -------
Excellent!  Thank you, Oliver :-)

Jake

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org