OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Objections to / uses of PSVI?

[ Lists Home | Date Index | Thread Index ]

Ronald Bourret:

> It's really a trade-off between interoperability and functionality. The
> more specific your data types are, the better your uses of those data
> types will be. For example, if you're generating Java classes from your
> schema and you really want a certain property to be an int, you'll do
> better having an int data type than a genericAnySizeInteger data type,
> which you will have no choice but to map to a BigDecimal.

I think this is the crux of my disagreement with your position (which I understand to be that of much of the static-types-in-XML supporters).  Amy Lewis nailed it when she suggested that the proper way to think of data types is against the problem domain, not the implementation language.  Worrying about how to faithfully reproduce, say, an unsigned int type interoperably is very backward when it is very likely that the equivalent value in your real world problem *truly* follows a constraint of 0 to 2^32.

If your data binding says "number from 0 to 300000" (maybe the value in problem space is velocity in meters per second), then why would your Java program use a BigDecimal?  (It so happens in this case that WXS can, in a very rough and ugly way, give you the needed capability for expression, but it cannot in the general case.)

Of course, by just blithely declaring it "int", and even more blithely binding it to Java, you've just lost the most effective means of preventing someone from using a value of 300001, which is the sort of thing that makes space ships blow up (not int versus float distinctions).

In my view, the sort of blind data binding encouraged by WXS types is the terror of interoperability, not the boon.  Programmers tend to miss this because they generate the mapping using shiny GUIs, and imagine nothing could possibly be amiss.

Bottom line: if XML were given a smart, generic constraint mechanism, rather than one working group's guess at a useful type libraries, then not only would your problem of data binding be solved as well, but you would also gain much more "type safety" and interoperability.

> I think what this points out is a fundamental difference in how people
> think data types should be used with XML. Many people want complete
> control over their data, saying you will use an int (short, long, etc.)
> to represent this piece of data.

My amazement is that this would be considered complete control.  Hardly.  It is extremely weak control.

Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One (San Jose, Boston): http://www.xmlconference.com/
DAML Reference - http://www.xml.com/pub/a/2002/05/01/damlref.html
The Languages of the Semantic Web - http://www.newarchitectmag.com/documents/s=2453/new1020218556549/index.html
XML, The Model Driven Architecture, and RDF @ XML Europe - http://www.xmleurope.com/2002/kttrack.asp#themodel


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS