Lists Home |
Date Index |
regarding your observations:
> The downside to conventional databinding is basically Permathread #x
> (hmm, we really ought to catalog them) -- rigid schemas imply a tight
> coupling between the data formats of producers and consumers of XML,
> and if things change (or can't be agreed on in the first place, or the
> consumer needs only a small subset of the information, or the
> community ignores the details of the "authoritative" schema ...) then
> the databinding solution is fragile.
> I'm not sure what BEA's tool does here, but *in principle* one might
> have the best of both worlds: Use XPath or XQuery to define the
> patterns to look for in input data rather than simply assuming a
> shared schema (thus loosening the coupling), but *generate* code that
> uses those patterns to map input data onto application objects (thus
> making life easier for the non-geeks).
You may find that SNAQue (http://cis.strath.ac.uk/research/snaque)
already satisfies your requirements.
It essentially allows programmers to project their assumptions, in the
form of a language type, onto XML data coming to binding.
If the data contains a subset that may be interpreted as a value of that
type (according to a set of pre-defined rules), that subset is converted
into the corresponding value and passed along to the programmer and its
As you can see, types do not come from the data but from the
application, and thus reflect the expectations of who consumes the data
rather than who produced it.. Partial bindings follow easily as a
corollary and with them the resilience of binding programs to changes in
the data which are irrelevant to those programs. IOW, subtyping for you
at the boundary of the language (and with the implication of a run-time
check). Mind you, I am talking of a proof-of-concept academic prototype,
do not expect features such as 'binding schemas' or anything else you
may want from a production release.
You will find on the website a number of publications on the
formalisation of the system, its comparison with SAX, DOM, JAXB, etc,
and a number of applications.