RE: Extending "choice" model group in a xsd schema

Michael Kay writes:

> The odd thing though is that the OO languages I'm familiar withtreat the
> fields/methods on a class as a set rather than a sequence, and a 
subclass
> can add members to this set; so they don't have any kind of user-visible
> constraint like the one in XSD that says the additions have to 
> be at the end
> of the sequence.

Ah, you youngsters.  In C++ it's pretty much a given that methods are 
mapped to vtbls in a predictable order, or at least that's my impression. 
More to the point, the order of mapping of structure (and thus class) 
fields is also significant.  Both of these orderings become part of the 
binary interface for C++ objects on any given platform, as different 
compilations of header files with references to the same classes need to 
get consistent vtbl offsets. 

Then again, C++ is arguably irrelevant to the XML discussion precisely 
because it does support multiple inheritance, with somewhat horrendous 
implications for those vtbls under the covers;  that multiple inheritance 
has no good analog in xsd:extension anyway, as far as I can see.  I agree 
that most widely deployed scripting languages, as well as Java-class 
languages tend to do name-based resolution at runtime, and in that sense 
treat the members as sets.

Noah


--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








"Michael Kay" <mike@saxonica.com>
01/08/2010 10:35 AM
 
        To:     <noah_mendelsohn@us.ibm.com>, "'Henry S. Thompson'" 
<ht@inf.ed.ac.uk>
        cc:     "'Jaikiran Pai'" <jai_forums2005@yahoo.co.in>, 
<xmlschema-dev@w3.org>
        Subject:        RE: Extending "choice" model group in a xsd schema


> 
> I think there was an intuition on the part of some members of 
> the working group that extension would not only be similar in 
> spirit to what is done for data inheritance in OO programming 
> languages, but that it would facilitate serialization of such 
> OO structures to XML. 

I thought it was probably something along those lines.

The odd thing though is that the OO languages I'm familiar with treat the
fields/methods on a class as a set rather than a sequence, and a subclass
can add members to this set; so they don't have any kind of user-visible
constraint like the one in XSD that says the additions have to be at the 
end
of the sequence.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

Received on Friday, 8 January 2010 15:51:21 UTC