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

Re: XML [~serialization] and Objects

  • From: David Brownell <db@E...>
  • To: "XML Developers' List" <xml-dev@i...>
  • Date: Tue, 29 Sep 1998 11:05:38 -0700

multiple xml elements serialization
(Welcome back, Steve!  ;-)

Steve Withall wrote:
> 
> At 00:28 29/9/98 -0700, David Brownell wrote:
> >
> >       <BEAN CLASS="com.example.foo.SimpleBean">
> >           <PROPERTY NAME="prop1" DCD:i4>49</PROPERTY>
> >           <PROPERTY NAME="prop2" DCD:string>hello world</PROPERTY>
> >           ...
> >           </BEAN>
> 
> The problem I have with this approach is that it limits you to
> specifying just a single class. Surely in the general case

This solution wasn't for a general case -- it was for a specific
one, serializing some Java data to/from XML using particular DTD
so that non-Java code could _potentially_ generate.  Many such
solutions are possible.

>	 one
> wants to be able to use an XML element to represent some sort
> of 'thing' (avoiding the word object), and it should be possible
> for multiple applications to use this XML document, each one
> possibly wishing to instantiate the 'thing' using a different class.

In the general case I'd go so far as to say that _some_ elements
represent a "thing", and many don't.  Existing DTDs aren't all done
with a particular object modeling paradigm, and so on.  One can't
deduce which elements represent objects, which represent properties,
which represent actions, and so forth without a data model in hand.

In the example above, that data model was captured in the spec for
that java class, which can be introspected at runtime.  In general,
that assumption must not be made.  (But it can simplify things a
whole bunch in those cases where you can assume a java.lang.Class!)


> I'd prefer the identification of which class a particular
> application should use for a particular type of element to
> be external (using DCD, for example). The document itself then
> remains 'purer'...

Right, that's a more general approach, and is very much akin to
the experimental "XML Beans" stuff in Sun's XML Library.  The
association is external to the document, and existing documents
can be used in a variety of ways.

As I noted elsewhere, I see those two approaches as basically
separate.  They can be hybridized, but I suspect that'd cause
confusion if not done with care.

- Dave

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/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe 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.