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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: XML APIs

[ Lists Home | Date Index | Thread Index ]
  • From: John Cowan <cowan@locke.ccil.org>
  • To: XML Dev <xml-dev@ic.ac.uk>
  • Date: Tue, 03 Nov 1998 12:48:14 -0500

Stephen R. Savitzky wrote:

> I do not understand your point.  They certainly hold as far as I can tell;

Provided the tree doesn't get modified while traversing it.

> Piling additional complication into the specification in order to ensure
> that every node in the tree will continue to be visited no matter what gets
> done between calls to "toNext", which I believe is what the last spec that
> included iterators attempted to do, is WRONG, because it makes the simple
> implementation impossible and because it becomes too complicated for a
> programmer looking at the spec to guess how it's going to behave.

Well, I disagree with you.  If iterators are to be useful, they must
be robust against changes to the structure being iterated over, or
at the very least they must warn that the iterator is no longer valid,
like the new Java 1.2 enumerators.

> The API is designed to have an obvious model that looks
> like a parse tree.  Any programmer, looking at that API, will ``see'' the
> parse tree in her mind's eye and be able to make intuitive and accurate
> predictions about how it will behave.

Indeed.  But soon after learning about live node lists, this model
will have to be changed or her programs will be dreadfully erroneous.

> They will then discover that, in
> the details of the specification, the intuitive view of the DOM as the API
> for tree-structured documents is WRONG, and that a great deal of non-obvious
> machinery has to be added in order to make it work.

You betcha.
> I'm going to go a little further, and define ``natural model.''  The natural
> model of an interface is a class in which all attributes are represented by
> instance variables, and no other instance variables are present.

The trouble with such a "natural model" is that it's dead.  It works
perfectly for values (which have no state, i.e. are immutable),
and for "dart boards" that react to whatever's posted to (thrown at?)
them, but not for anything with any liveness.  A robot modeled by such a
"natural model" would be more like a Barbie doll: poseable, but unable
to move by itself.

John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

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