[xsd-users] Seperation of Data and serialization code

Balasubramanyam, Shivakumar sbalasub at qualcomm.com
Fri Feb 1 19:12:49 EST 2008


Boris,

The constructors could still be retained but with only simple types.

IMO, constructors that accept parsing objects (like :xercesc:DOMElement)
could also be implemented as operators that can reside in a different
file or library, which will be used by serialization feature.

Could you please elaborate on the role of global functions? Are these
basically the registration or mapping of XML nodes to serialized class
types?

I am sure this is really challenging problem for implementation.

Thanks,
Shiva

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Monday, January 28, 2008 11:19 AM
To: Balasubramanyam, Shivakumar
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] Seperation of Data and serialization code

Hi Shiva,

Balasubramanyam, Shivakumar <sbalasub at qualcomm.com> writes:

> Is there anyway today that I can separate the code generation of the
> Data (representing the XSD schema) and the serialization code?
>
> This would mostly help the layering of the software where the software
> modules would just depend on the data and does not know how it is
> actually being serialized in the system. For example, we may move from
> XML to XDR or to Custom serialization library, but that would not
> require re-building the application software.

There is no way to do this at the moment. By serialization I assume
you mean both XML (or binary) parsing and serialization. If that's
the case, then there is one problem with supporting something like
this in the future. While it is possible to separate serialization
from the object model because it is implemented as operators and
global functions, this approach won't work for parsing because it
is implemented as constructors and global functions.

We choose to use constructors for parsing in order to make the
interface help prevent construction of invalid object models by not
providing default constructors for types with required elements or
attributes. If we used something other than constructors for parsing
the we would have had to provide default constructors for all type
since parsing would have been performed in two steps: construction
first and then parsing.

Boris




More information about the xsd-users mailing list