Sunday, June 04, 2006

eXist examples

I now have somewhere to host my example XML database examples.

http://www.cems.uwe.ac.uk/chriswallace/index.xql

This supercedes the previous hosts for my teaching applications on a friend's server and on the exist-db demo server.

There are a few there, but further development will have to wait till the end of the term. Few typos I've just spotted :- (

One problem I faced was to allow a visitor to view the Xquery files themselves. I initially saw this as a eXist problem, needing an eXist solution, and indeed Adam, one of the eXist developers, put in a feature to support this. However I slowly realised that if I wanted to put up a number of examples (there are about 9 in various stages of development) , I should develop a schema for an application index page, and individual XML configuration files instead of writing unique pages. I can then use XSLT to display the page. If I then wrote an Xquery to fetch a query and display it , I could use the application configuration XML to authorise access to the scripts.

This experience prompted or reminded me of a couple of computing adages:

  • The only numbers of importance in computing are 1, 2 and many- with its meta counting variant: 1, 2, Schema
  • Use of the configuration file to generate the web page and to authorise access to the script as an example of the Shanley principle - in which one component serves multiple purposes see Michael Jackson, Software Requirements and Specifications, Addison-Wesley 1995, p29-30].

In future, I want to enhance this configuration file to be a description of the application architecture and information flow, so I can also generate, via GraphViz, a clickable SVG image of the application.

That's the problem with eXist and XQuery: this technology greatly reduces the time needed to create an application, but it increases the range of ideas for applicatins which can be easily implemented even more!