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

Re: Mapping: Schema - Java

  • From: Stefan Haustein <haustein@k...>
  • To: Ken MacLeod <ken@b...>, xml-dev@X..., dbox@d...
  • Date: Mon, 13 Mar 2000 11:05:50 +0100

stefan with circle k
Ken MacLeod wrote:
> How do you mean "like in the array case"? 
> For reference, using the 8.4.1.1 generic record serialization to
> serialize objects seems natural to me.


Imagine an abstract Class Drawable with fields x and y and 
a subclass Circle with an additional field r.

An array property containing  
GraphicsObjects would be serialized as

<bar xsd:type="Drawable[]">
  <Circle>
    <x>6</x>
    <y>7</y>
    <z>8</z>
  </Circle>
  ...
</bar>

A simple property "foo" containing 
a single Drawable of type Circle would 
be serialized as

<foo xsd:type="Circle">
  <x>6</x>
  <y>7</y>
  <z>8</z>
</foo>

Thus, you cannot implement a simple 
method that serializes an object
including the type information:

In the case of a simple property,
you need some "magic" to put the
type information into the 
type attribute of the property 
element.

It is not impossible, but it is
ugly from an OOP and SML point
of view.
 
Best regards,

Stefan
   
> Stefan Haustein <haustein@k...> writes:
>
> > "Box, Don" wrote:
> > 
> > Right. The SOAP approach is similar in spirit to the SML approach
> > - that is, if your goal is to use XML as a serialziation format
> > for your application's types, Section 8 defines a uniform method
> > for translating standard programming language constructs (e.g.,
> > struct, class, array) into XML and XML Schema. This method is
> > largely a formalization of element-normal-form encoding (which is
> > a/the core concept in SML).
> 
> Hm, if I read the specs right, something looking more or less like 
> object serialization is described in "8.4.1.1. Generic Records".
> 
> Wouldn't it be more appropiate to have an own section for object
> serialization (e.g. 8.4.1.2)? The "generic record" serialization
> makes it uneccesarily difficult for objects to serialize 
> themselves completely: The object description is broken into 
> the type attribute of the property element and the object
> content itself. Couln't objects just always be serialized
> like in the array case? 

-- 
Stefan Haustein
University of Dortmund
Computer Science VIII
www-ai.cs.uni-dortmund.de

***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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.