[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Object-oriented serialization (Was Re: Some questions)

  • From: Vane Lashua <vlashua@R...>
  • To: 'Colas Nahaboo' <Colas.Nahaboo@s...>, Matthew Gertner <matthew@p...>
  • Date: Fri, 3 Dec 1999 11:03:27 -0500

nahaboo
I think you're mixing apples and oranges.

An even simpler declaration of your example below -- and correct in XML --
would be:

<Point value="12in,2cm;RFFx,G0,B0" />

or:

<processingsegment lang="Java" content="Point {Length x; Length y; Color
color;};" />

or:

<? Java Point {Length x; Length y; Color color;}; ?>

XML is a storage medium. Java source code is a storage medium. XML may
contain Java source code syntax, as Java source code may contain XML syntax,
but both need processors to do more.

And by the way, SGML grew out of a world of extremely limited and narrowly
typed data processing  _and_ fixed length records. Data typing in SGML is as
simple as adding an attribute to an element declaration. It is up to a
processor to know how to use it. Just as it is in Java.

Vane

-----Original Message-----
From: Colas Nahaboo [mailto:Colas.Nahaboo@s...]

Matthew Gertner writes:
> The aspects of
> object-oriented design that are missing are then inheritance and
> polymorphism. 

In my opinion, things may be more simple. If SGML/XML had not been designed
by
people living in a typeless world (text documents), XML could have provided
a
much better medium to express object instances, with such a simple design as
getting rid of element contents, and allowing attributes contents to be XML,
e.g:

<Point
  x=<Length unit="inches" value="12"/>
  y=<Length unit="cm" value="2"/>
  color=<RGB R=<Number base="16" value="FF"/> G="0" B="0"/>
/>

matching a C/C++/Java... declaration of Point as:

Point {
  Length x;
  Length y;
  Color color;
};

As you can see, this would be a very elegant and natural way to express
object
instances (aka serialization). One would of course need a schema language on
top of that (to express what I wrote in a C-like declaration), but having to
tweak the "low-level" serialisation to fit in the
current XML1.0 recomendation is I think the original sin of XML, which
pollutes a lot of the discussions I see here. For instance the current drive
for removing attributes results from this.
 
But, just like RDF, we could standardise on this non-XML-1.0-compatible
(lets
call it GXML for Generalized XML :-) representation, and devise a canonical
way to express it in XML.  For instance:

<Point>
  <_x><Length unit="inches" value="12"/></_x>
  <_y><Length unit="cm" value="2"/></_y>
  <_color><RGB G="0" B="0">
       <_R><Number base="16" value="FF"/></_R>
  </_color>
</Point>

but we could devise others...

--
Colas Nahaboo, Koala/Dyade/Bull @ INRIA Sophia,
http://www.inria.fr/koala/colas


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

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



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.