Frank Budinsky wrote:
> Jeremy,
> 
> The XMLStreamHelper load (using the StAXtoSAXAdapter) is already in. I'm 
> still working with Raymond on the save methods.
> 
> To try to clarify the role of StAXElementLoader ... how do you see 
> generated SDO POJO handlers working with it? Once we generate a loader, 
> how does StAXElementLoader.load() relate to it? How is the "plugability" 
> of binding technology supposed to work here?
> 

The main plug point is intended to allow people contributing extensions
(typically implementation types or bindings) to use the technology of
their choice to handle the XML stream.

So, for example, if I am writing the "foo" implementation type, I write
a StAXElementLoader that registers to handle the
"<foo:implementation.foo>" element. When that element is encountered,
the loader is invoked with the stream positioned on that element. The
loader is responsible for consuming the stream and returning the
applicable ModelObject (in this case, something that is an Implementation).

To use SDO, the loader would hand the stream to the SDO XMLStreamHelper
and return the result from load as the model object. Dead simple if SDO
can handle all elements in the stream. This will be true in most cases
unless the "foo" schema itself contains extensibility elements. The
"foo" loader then has two choices:

1) it allows SDO to create ANY DataObjects or dynamic SDOs and then uses
   its own extensibility mechanism to handle them

2) it interfaces with SDO to get a callback when the unknown element is
   encountered, then calls back into SCA's Loader with a StAX stream
   positioned on the element (it could be the same StAX stream passed in
   or it could be a new one created by the loader). It passes the object
   returned back to SDO as the result from the callback.

In either case the interaction is between the loader extension and SDO
which means that the core remains isolated from the choice of binding
technology made by the loader's implementor and that the implementor can
pick a technology they are familiar with.

--
Jeremy

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

Reply via email to