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

Re: XML APIs

  • From: John Cowan <cowan@l...>
  • To: XML Dev <xml-dev@i...>
  • Date: Tue, 03 Nov 1998 12:48:14 -0500

xml apis
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@c...
	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@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.