Object-oriented serialization (Was Re: Some questions)

Matthew Gertner matthew at praxis.cz
Thu Dec 2 09:26:30 GMT 1999


David Megginson wrote:
> Perhaps I'm a little confused, but I cannot see how the fact that a
> schema language itself happens to be object oriented allows you to do
> object exchange in XML (it doesn't hurt, but how can it help?).
> 
> I've been confused before, so there's no need for panic.

I'm not entirely sure whether or not I am confused myself. Let me give
this a crack, and I'm sure someone will be happy to tell me why I am
wrong. :-)

Let's say I have an arbitrary object structure that I want to serialize
and send down the pipe. Serializing a bunch of object attributes in XML
is a no-brainer, and representing arbitrary references between objects
is also fairly trivial if something like XLink is used (and we need
XLink, there's surely no controversy about this). The aspects of
object-oriented design that are missing are then inheritance and
polymorphism. This is why an object-oriented schema language is needed:
to do this properly I should be mapping each of my object classes to a
specific element type, and I need to be able to say that a given element
type extends a base type if this type of relationship is present in my
original object schema. Rich data types are also needed although this
doesn't have to do with object-orientation per se. Polymorphism is about
behavior and should be implemented in schema-aware tools.

I honestly feel that XML provides all the tools to do what RDF is trying
to do, without an additional syntactic layer. What is missing from the
picture is a mechanism for modelling object structures according to
object-oriented principles, and this is why an OO schema language is
necessary. The only other thing the RDF brings to the game is that it
turns relationships into first-class objects that can be referenced as
well, but I don't know any OO language that enables this without
modelling it specifically (i.e. creating an object to represent a
reference), and this can be done in an analogous way in XML as well.

If I may, let me turn your question on its head: what about an XML
Schema approach doesn't let you do object exchange in a satisfactory
manner?

Matthew

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list