XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Native XML Interfaces

On Mon, Jun 3, 2013 at 1:12 PM, Norman Gray <norman@astro.gla.ac.uk> wrote:
On 2013 Jun 3, at 12:12, Andrew Welch <andrew.j.welch@gmail.com> wrote:

> They could:
>
> - use xquery/xpath
> - use xom/jdom
> - use sax/stax
>
> instead they use a tool to generate an xsd from the xml, then use a
> binding tool to generate some classes, then use those generated
> classes.


o_O

And we wonder why developers come to detest XML!  Who the heck suggests such a Rube Goldberg as the way to go?  The problem statement was "extracting the <title>  and product/@id values from some xml."  That's about 5 lines of code and 5 minutes (admittedly to one who knows it) in Amara, and just to make the point with another toolkit, I bet it's no harder with David Lee's xmlsh.  If we as a community insist on only ever teaching developers difficult ways of dealing with XML, I guess what do we expect?
 

For a while now, I've been involved with a collaboration (to do with astronomy software) arguing about the standardisation of (amongst other things) XML Schemas.

One of the use-cases in those arguments involved generating (Java) classes from XSchema files, but I think this was generally regarded as a rather freaky or marginal use-case, because of the obvious fragility of that approach.  I'm not sure whether even the people pushing that use-case have actually gone down that route.  I think, but I haven't done any census, that a lot of people keep it simple with SAX.

Whatever they did, that or something like it has made the collaboration strongly averse to any schema changes, because 'it breaks things' expensively.  This links back to a recent megathread; I can't help feeling that a parsing layer which is layered on top of SAX will tend to be naturally more robust in the face of minor schema changes, than one based on generated code.

Agreed, but let's admit it.  Callback programming is hard, and most developers don't get it right either, continuing the expensive-breakage problem.

 
Myself, I can see _some_ rationale for generating code from XSchemas, in specialised circumstances, but generally I guess it would be a tooling-rich way to produce large quantities of rubbish black-box code.

+1 "rubbish black-box code" is a great way to describe what XML Schema-driven toolkits tend to produce.


--
Uche Ogbuji                       http://uche.ogbuji.net
Founding Partner, Zepheira        http://zepheira.com
http://wearekin.org
http://www.thenervousbreakdown.com/author/uogbuji/
http://copia.ogbuji.net
http://www.linkedin.com/in/ucheogbuji
http://twitter.com/uogbuji


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS