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

Re: attribute order


fundamental unit of chemical matter
On Sun, 2005-05-08 at 05:39 -0700, Mukul Gandhi wrote:
> I wrote earlier that, I would like to imagine elements
> as objects(as in OO programs) and attributes as
> object's properties.. Is it right to think like this?

It can be very dangerous thinking overall.  I've seen numerous examples
of poor XML design because of too literal a translation from OO
concepts.  Just for one example, see [1] for discussion of confusion
that arises from the fact that most "object references" in XML are
implicit.

As for the specific question of XML versus attributes, I still think
it's a weak approach.  OO concerns such as identity and data typing
which drive the matter in program modeling have poor natural
correspondence in XML.  I think you'd be fine with such an approach with
trivial examples, but the elements/attributes choice is usually trivial,
anyway, if the example is also trivial.


> So attribute ordering will not be the right concept.. 

Well, not so quickly.  In OO, object references aren't ordered, either
(you need to use an explicit vector to get order), so element ordering
wouldn't be the right concept, either, if one were being so literal.

I think XML requires an entirely different mind-set from objects.


> The dictionary defines attribute as quality,
> characteristic, feature etc. An object's features
> (i.e. attributes) are just features! Giving an order
> to them does'nt seem right..

I also don't think this is fruitful territory.  One could pick a
dictionary definition of elements (e.g. the agents of weather) where
order does matter, and one (e.g. the fundamental units of chemical
compounds) where order does (at least in the sense of structuring in the
periodic table).  Again, I see nothing but misapprehension and confusion
down this road.

Just as it's dangerous to do relational modeling in an OO mind-set, and
vice versa (part of the reason those two worlds have so stubbornly
resisted merging [2]), it's dangerous to do XML modeling in either mind-
set, and so on.

[1] http://www-106.ibm.com/developerworks/xml/library/x-contain.html
[2] http://www.adtmag.com/article.asp?id=8596

see also debate of [2] at http://www.adtmag.com/article.asp?id=9090

-- 
Uche Ogbuji                               Fourthought, Inc.
http://uche.ogbuji.net                    http://fourthought.com
http://copia.ogbuji.net                   http://4Suite.org
Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcss2-i.html
XML Output with 4Suite & Amara - http://www.xml.com/pub/a/2005/04/20/py-xml.html
Use XSLT to prepare XML for import into OpenOffice Calc - http://www.ibm.com/developerworks/xml/library/x-oocalc/
Schema standardization for top-down semantic transparency - http://www-128.ibm.com/developerworks/xml/library/x-think31.html


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.