[xquery-talk] [AW] XQuery and Item Orientation

Hans-Juergen Rennau hrennau at yahoo.de
Thu Jan 22 06:58:56 PST 2009

*** Retry of a previous mail - according to a bounce mail parts of it had been lost ***
*** Sorry for any inconvenience ***

Yes, the proposed item orientation is very closely related to XSLT's
pattern matching. But I want to emphasize a difference of perspective:
XSLT's polymorphism does not breathe object-orientation. It is meant
for, as you put it, "dealing with data whose structure is variable", it
is less appropriate for creating interfaces whose abstraction hides the
variability of concrete behaviour. I perceive templates in the first
place as a mechanism for uniform triggering of variable processing -
trigger it and get it done. Just compare the ease of using a function
call within an expression with the cumbersome voodoo required for
catching a template's output and make it input for further processing!
I am just trying to say that polymorphic functions would introduce
something into X-technology that XSLT's templates do not well cover:
the possibility to create "abstract" applications based on abstract
functionality, to be extended by concrete (function) implementations in order to become a runnable application.

example. Consider a tool for evaluating logfiles based on a conceptual
framework which views the data as grouped into named domains and within
domains into types, allowing further differentiation by judging the
relationships between a given log event to system entities. Domains,
type-defining keys, relationship judgments - all can be specified in
terms of XPath expressions or simple XQuery functions. This framework
allows the design of sophisticated applications which are structurally
independent of the actual choices of names, paths and functions.
Polymorphic functions would be very helpful to *implement* such
applications, ready to be extended by the missing function
implementations (here yielding names, paths and judgments) in order to
become a running application.

Perhaps the point of view depends
on whether one regards XQuery as a query language or as a data
processing language with superb query capabilities.

With kind regards -
Hans-Juergen Rennau

----- Ursprüngliche Mail ----
Von: Michael Kay <mike at saxonica.com>
An: Hans-Juergen Rennau <hrennau at yahoo.de>; talk at x-query.com
Gesendet: Dienstag, den 20. Januar 2009, 00:50:12 Uhr
Betreff: RE: [xquery-talk] XQuery and Item Orientation

What you're proposing isn't that far removed from XSLT's pattern matching
capability. And of course as any XSLT user knows, this kind of polymorphic
despatch mechanism is extremely valuable in dealing with data whose
structure is variable. Of course XSLT's patterns are more flexible than what
you are proposing, because they match against arbitrary predicates, not only
against the type hierarchy - again, that's needed because of the variety of
ways in which people express structural relationships in XML.

The XQuery designers have been very opposed to any kind of dynamic despatch
or polymorphism, because it makes many kinds of static optimization
impossible. In this sense, the language is optimized for the large database
environment where user convenience has to be sacrificed to the needs of

Michael Kay


More information about the talk mailing list