OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: XML and Objects

[ Lists Home | Date Index | Thread Index ]
  • From: "Thomas, Alex" <Alex.Thomas@dresdner-bank.com>
  • To: XML Developers' List <xml-dev@ic.ac.uk>
  • Date: Tue, 29 Sep 1998 16:53:27 +0200

I'd also like to know if there's a reason a bean couldn't use specific
property names, 

>	    <PROPERTY NAME="prop2" DCD:string>hello world</PROPERTY>

becoming

	    <PROP2>hello world</PROP2>

(I guess an implicit DCD is OK too). 

I don't have a problem with bean XML data specifying a specific class -
after all, it's just another layer and it's quite reasonable for people to
choose to conform to that layer (the bean interface) rather than the XML
data level. Even if there are multiple implementations of that bean, a
single 'class name' should be sufficient - it could either be a pointer to a
spec. for multiple alternative classes (e.g. one C++, one Java) or a spec.
unifying them at some higher level (using IDL for instance).

cheers
Alex


-----Original Message-----
From: Steve Withall [mailto:stevew@access.com.au]
Sent: 29 September 1998 09:05
To: XML Developers' List
Subject: Re: XML and Objects


At 00:28 29/9/98 -0700, David Brownell wrote:
>For example, in Java it's (way) easy to put together something that
>can "serialize" (not in the "java.io" sense though) beans like:
>
>	<BEAN CLASS="com.example.foo.SimpleBean">
>	    <PROPERTY NAME="prop1" DCD:i4>49</PROPERTY>
>	    <PROPERTY NAME="prop2" DCD:string>hello world</PROPERTY>
>	    ...
>	    </BEAN>
>
>Then reading it back in Java is a case of taking the "CLASS" tag
>and instantiating, then assigning properties.  In C++ it'd need a
>table associating that class with some custom generated C++ stuff.
>Plus of course there are corner cases like wanting to emit strings
>containing characters that are not legal XML -- formfeed, BEL, and
>so on.  (That'd be one reason why when I did such stuff, I didn't
>use DCD.)  Reflection makes stuff like that rather simple to do;
>you can use custom generated code, but don't need to.
>
>That particular solution doesn't require DOM at all. 
>
>- Dave
>
Dave,

The problem I have with this approach is that it limits you to specifying
just a single class. Surely in the general case 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.

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', uncluttered with this
application-specific information.

Also, I assume (hope!) you're using the element name 'BEAN' just as an
example, and that in practice you'd use 'meaningful' element names. This
would, however, make the use of 'PROPERTY' attributes more problematical.

Cheers, Steve.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following
message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)


Alex Thomas
Dresdner Kleinwort Benson
London EC3P 3DB

Alex.Thomas@Dresdner-Bank.com

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS