2-1. Should XMLHelper support both saving and loading DataGraph?

Spec 2.1 page 11 (2 Architecture) says
   "Data graphs can be serialized to XML, typically by the XMLHelper or by
an XML DAS."
It may imply XMLHelper should support saving DataGraph.

At the same time, spec 2.1 page 45 (3.11 XMLHelper) says
   "An XMLHelper converts XML streams to and from graphs of DataObjects."
There might be readers intepreting that XMLHelper should support loading
DataGraph.

2-2. How to support DataGraph if XMLHelper should?

Currently, we use SDOXMLResourceImpl to save/load DataObject and
DataGraphResourceFactoryImpl.DataGraphResourceImpl to save/load DataGraph.
It's trivial for XMLHelper to pick a ResourceImpl to save corresponding to
input object.
However, it's not trivial for XMLHelper to pick a ResourceImpl to load
corresponding to input stream.
I have 2 solutions; let me know your preference; alternatives will be
appreciated.

2-2.1. Merge DataGraphResourceImpl capability into SDOXMLResourceImpl

It takes longer to implement. However, we can eliminate
DataGraphResourceFactoryImpl afterwards.

2-2.2. Parse stream portion and use corresponding ResourceImpl

It takes shorter to implement. However, the solution isn't trivial since
stream may not support reset, where the parsed portion has to be recorded
and played back.

--

Yang ZHONG

Reply via email to