[xsd-users] Using XSD for partial XML Data Binding in a large application

Marco Fischer marco.fischer at chipvision.com
Thu Mar 2 05:50:52 EST 2006


Hi,

suppose you have a large application and want to use data binding for 
a portion of the application's data model. I encountered the following
problem: since the data binding models only a part
of the whole data model, the interface of the generated classes might be
only a subset of what is actually desired in the application.

For example, the application wishes to access an element X associated
with an element A.

 ____________                  ____________
|      A     |                |      X     |
|____________|                |____________|
|            |          ref   |            |
|            |--------------->|            |
|____________|                |____________|


If both elements are modelled in the data binding, the generated class
for A provides an appropriate member function, something like

X A::ref().

If X is not part of the data binding, then of course there's no such
member function. There could also be needs to have other member
functions in the interface of A, not modelled in the data binding.

What would be a good approach to integrate a "partial" data binding into
an existing application?
Does it make sense to write a set of adapters/wrappers which encapsulate
instances of data binding model objects, and provide/extend their
interface as required by the application? This approach seems to be a
bit redundant, as the purpose of data binding actually is that the
application can use the model objects directly.

Is there any possibility to specify member function stubs to be
generated for model objects, which can be implemented manually?

Thanks for any thoughts or ideas...

Cheers,
Marco





More information about the xsd-users mailing list