Paul Hammant wrote:
> >cfg.getChild("somechild").getChild("anotherchild").getValueAsLong();
> >
> That's what Configurable gives already.  We're dwelling on the setting
> of config rather than the getting of it in this discussion.

Yeah, I know...  It's a simple, straight-forward approach, which is why
I suggested sticking with it.  Should have use the setValue as an
example instead of getValue... 

>   setableCfg.getChild("somechild").getChild("anotherchild").setLongValue(14);
> 
> How that?

Fine by me.  Another thing that we do in our configuration system is the
idea of a ConfigurationCallback interface, so for example:

   colConfig.processChildren("collection",
      new ConfigurationCallback() {
         public void process(Configuration cfg) throws dbXMLException {
            Collection col = new
Collection((Collection)CollectionManager.this);
            col.setConfig(cfg);
            collections.put(col.getName(), col);
         }
   });

This would behave in a similar fashion to getting the child set by name
except that there wouldn't be the additional overhead of having to
produce an array and then iterate over it.

-- 
Tom Bradford  The dbXML Group, L.L.C.  http://www.dbxmlgroup.com/
Desktop, Laptop, Settop, Palmtop.  Can your XML database do that?

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

Reply via email to