This article looks at the impact of schema evolution on the application and walks the reader through a usage scenario to illustrate the ease of setting up a PHP environment; the ease of integrating DB2 native XML functionality with PHP applications, including Web services written in PHP and XQuery.
Simplify Apps using XML with PHP and DB2
2005-11-15 General Development 4 Comments
Simplify Apps using XML…
Hmm…let’s look in the article:
Note: An assumption we are making for this scenario is that the business data is already in XML…
The database with limited or no XML capabilities would store the XML data either as a CLOB/BLOB data type, or shredded to relational fields.
Ahh… yes; “shredded” is an apt description for dealing with data in a logical manner. And, “Simplifying” an application by learning XML querying in addition to regular SQL querying… this just takes the cake.
Look at the code examples: even taking into account the horrible PHP coding approach to the non-XML database method (not to mention using such a limited DBMS as MySQL), the non-XML approach is still the more concise way, and easier to understand.
Also, we have this wonderful approach of handling “publishing” in the database. Isn’t it supposed to be wrong to mix presentation and logic? At least, for a well-designed application?
By the way, I could easily do everything that this “native XML” system does simply by creating stored procedures in PostgreSQL, and using the procedure to plop the data inside the HTML strings before returning.
Although, that would be the wrong way to do things. Once we have the database handling presentation, then that means we must write extra queries every time we want to access the same business logic from a different application environment (RSS, WAP, etc…).
Then, the big question: “simplifying” the database design by banishing product details, order details, and customer details into the XML dungeon, means now we must also use XML querying to run reports on sales, generate statistics, make “decision support” queries, etc…?
Nothing to see here… move along.
I really expected better from IBM (or at least someone who was allowed to post on an IBM site).
What have we learned in the past 20 years? Seperate your concerns! Who on earth would put presentation in the DB…and to the extend that this guys suggest via the stored procedure (which is another issue entirely).
Oh well…back to my job where I have to clean up other people’s messes who have never heard of this simple concept.
someone ought to tell the intern to look up indentation.
I enjoyed reading about the future XML capabilities of DB2. I thought it looked impressive, and the PHP examples given are just that: examples. Nothing to build a production-ready app around.
Thanks for the link, OSNews.