> -----Original Message-----
> From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
> Sent: den 1 oktober 2001 16:34
> To: Avalon Development
> Subject: Re: [Vote] Namespace support for Configuration objects
>
>
> >
> > (In fact, I'd like to extend the Configurable interface with one method:
> >
> >   Node getValueAsDOM ();
> >
> > Then, you can not only store Strings, ints, booleans and
> floats, but also
> > XML data in configurations.)
>
> I would be -1 on this.  Configuration is built from SAX
> currently, and adding
> DOM nodes to the Configuration tree removes one of their main virtues: the
> fact that they consume fewer resources.

That would only be a virtue if you have massive amounts of configuration
data in the system. So much, in fact, that it overwhelms any other category
of objects. I have not encountered any example of this.

Storing DOM nodes in configurations is resource-intensive, yes, but:

a) few types of configuration require massive amounts of DOM data.
b) There is only one instance in the whole system, if it is used by the
ExcaliburComponentManager. The CM loads the config and portions out parts of
it to its components.

so the gain by using SAX over DOM is not as great.

However, Cocoon2 has (had?) an XML compiler that transformed
SAX->bytestream. Maybe a

  getValueAsCompiledXML ()

or

  streamValue (ContentHandler ch)

The configuration would then be:

 <myvalue>
    <avalon:xml>
       This text will be sent <b>along with the tags</b> to the
<i>ContentHandler</i>
       below.
    </avalon:xml>
 </myvalue>

Now:

  Configuration config = ...

  Configuration myvalue = config.getChild ("myvalue");

  myValue.stream (ch); // Fires startDocument, characters, startElement (b),
characters,
                             // endElement (b), characters, startElement (i), 
characters, ...

/LS


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

Reply via email to