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

Re: Early Draft Review: XQuery for Java (JSR 225)


0
Bob Foster wrote:

>
> The main advantage of your proposal, OOP orthodoxy aside, seems to be 
> in preventing syntactically incorrect queries. Given that this is an 
> API to XQuery, however, the user probably already has some knowledge 
> of XQuery syntax...and has the benefit of being able to test the 
> queries with specific values in a standalone XQuery implementation. On 
> the con side, building up expressions using individual For, Where, 
> etc. classes is certainly going to be clumsier.
>
Well, you can also plug queries together like legos - orthodox or not, 
it is not the same as ripping apart and glueing together strings.

> AFAIK, one could implement what you propose on top of the JSR 225 
> proposal (when evaluated, the objects would simply output a string), 
> but I don't think I'd want to use it. That's not a technical 
> judgement, though; just a matter of taste.
>
I agree it feels clumsy at first. But then, in an application one builds 
queries in a dedicated package, and one will appreciate resuing certain 
"typed" building blocks over the typical cut-and-paste madness.

Do you remember what happens with your SQL statements and queries if a 
column was added or renamed after you wrote your program ?

You will have to scan your entire program for occurrences of this table, 
check whether there was a SELECT * FROM or an INSERT INTO which does not 
work with the old set of column names. A bit of OO abstraction could 
have certainly helped also JDBC.

Evangelism aside, it is not an either-or question. Some library built on 
top of the string-based API (like Squiggle) is not likely to implement 
all functionality you get with XQuery. Rather, some users (if 
knowledgeable of the benefit) will reimplement their own things on top 
of the string-based API *over and over again*. For me this seems like a 
weak design (and here it becomes a technical judgement).

Instead, focussing on trees, and offering a string-based API for 
"compatibility" reasons, seems better since it keeps all doors open - 
hence a good design.

cheers,
Burak

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.