axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eran Chinthaka" <chinth...@opensource.lk>
Subject RE: [Axis2] Databinding API issues
Date Fri, 19 Aug 2005 11:13:18 GMT


> 
Hi Dennis and all,

I'd like to comments on only some points of your mail.


> I took a look at the XMLBeans data binding implementation for Axis2, and
> have got some questions about this. For one thing, it looks like the
> toOM() methods actually build the OM representation of the databound
> objects, while I thought the idea behind Axis2 was to keep the OM
> virtual unless absolutely necessary (for something like signing).
> 
> Also, the way in which Axis gets the data out of the databound objects
> is by using an XMLStreamReader. AFAIK, XMLBeans is the only framework
> which directly supports using a reader to get the XML representation of
> the objects. Most frameworks (including JiBX and JAXB 2.0) only support
> push-style output, where you tell the framework to serialize the XML
> representation to some form of output interface and it does so before
> returning. We could write an adapter to basically store the output from
> one of these frameworks and make it readable using an XMLStreamReader,
> but it would probably have a substantial impact on performance.

Well once I wrote an ObjectToOMBuilder, which was a builder who can build
the OM tree using a ContentHandler. But this was removed from the code, as
it was not fully implemented.
Anyway, my idea to this is to have a builder which can build from the push
interface. We can register a content handler with the data binding framework
and this in turn will pass the events to the special builder. Some times
this builder may implement the ContendHandler interface and I don't wanna
talk about the impl details at this point. 

So if we go back to initial idea of OM, OM should be able to read and write
both pull and push interfaces. So using the above method we can make OM read
from push. And Ajith wrote the serializer to serialize even to push
interface. 

> 
> For other data binding frameworks it's probably best to define a special
> type of OMElement to hold on to the object and the corresponding
> serializer until the serialize() method of the OMElement is called, then
> serialize directly to the supplied target. If we need to instead create
> a full OM representation, we can use a builder that implements the
> XMLStreamWriter interface and supply this to the binding framework as
> the target for the marshalling output. 

Well, I don't think the providing of XMLStreamWriter interface would help
for data binding frameworks other than XMLBeans.  

-- Chinthaka 

> This does make for an
> all-or-nothing expansion, but this is probably the best we can do with
> most data binding frameworks.
> 
> There's also the issue of how to link data binding to the MTOM support,
> so that a data binding framework can pass off components to be
> marshalled as attachments (and likewise access attachments for
> unmarshalling). I don't know if XMLBeans has any support for this yet,
> but JAXB 2.0 has it and I'll be adding it into JiBX.
> 
>   - Dennis




Mime
View raw message