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

Re: Sean McGrath hits a home run


shawn mcgrath
On Mon, 16 Dec 2002 16:15:34 +0000, Miles Sabin <miles@m...> wrote:


>
> I think there's a slightly different lesson to learn from Sean's experience. 
> Partly it's just that a lot of APIs are badly designed ... in a lot of 
> cases that's because the designers don't really understand what's going 
> on in the system (having seen the inner workings of rather too many HTTP 
> client libraries I'm sadly convinced that's all too often the case).

I think I agree. (I think we've had this discussion about Sean's article 
before, sorry if I'm repeating, or contradicting :-) myself):

This all goes back to OOP 101 - an API allows one to manipulate an "object" 
without knowing its internal representation, i.e., the principle of 
encapsulation.  But an API is only as good as the abstraction of the class 
of objects that it embodies.  Perhaps the other HTTP APIs represented bad 
abstractions of what's actually going on ... and ultimately became more 
trouble than they were worth, at least to a skilled programming needing 
non-trivial access to the protocol features.

But especially with committee-written standards (and I think this reflects 
the points in Daniel Veillard's post) there may simply be no coherent 
abstraction that can be cleanly encapsulated.  I don't know enough about 
HTTP to have an opinion if the APIs are merely bad, or if they reflect an 
unpleasant reality about the conceptual integrity of the underlying 
protocol.  (I would tend toward the former).  But with XML, having spent 
quite a bit more of my life that I will probably care to admit on Judgement 
Day working on APIs for it, I think it's hard to argue that there is a 
clean abstraction that can be exposed with APIs and implementations can be 
hidden behind.  Sheesh, we can't even agree if XML has a "data model" at 
all, much less on whether namespace URIs are associated with each node in 
their scope or only with the scope itself.  Thus, some questions are 
unanswerable, such as "what happens when I move a node from one namespace 
scope to another"?  Does it bring its namespace URI along with it, or does 
it get the one in the new scope?

As a practical matter, "edit the syntax to make it look like you want, then 
re-parse" is the most reliable way to avoid such messes. As a Best Practice 
guideline, Sean's advice is right on.  But I think this is more of a 
symptom of XML's need for some serious refactoring and cleanup rather than 
a reflection of a deep truth about APIs per se.

[Heigh ho, heigh ho, to the "does XML [expletive deleted]" permathread we go ...]

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.