[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Schema equivClass.

  • From: Stefan Haustein <haustein@k...>
  • To: Steve Harris <sharris@p...>
  • Date: Fri, 04 Feb 2000 10:23:13 +0100

xml schema polymorphic
> > BTW, a similar problem exists in C++:
> >
> > consider class A, class B extends A
> >
> > you cannot assign an instance of B to an A variable because it may
> > consume more memory and thus not fit...
> 
> If B extends A, then A was probably not designed to accept assignment
> from the then-unknown type B. You can slice B to cram it into A, but
> of course you shouldn't. I'm not sure of any scenario where you would
> want to assign a concrete B to a concrete A.

Can you please explain me then why Michael Anderson expected 
exactly this behaviour in XML Schema? If OOP is watered for 
efficency or legacy reasons in C++, that's OK to me. But when
creationg something new like XML Schema, it's probably a good 
chance to do it a bit more elegant. 

> We use the Standard C++ containers with pointers all the time. You can
> take a container of A*'s, put your A*'s and B*'s (and any other types
> derived from A) into it, and call polymorphic methods on the elements
> using the std::mem_fun* functors.

Ah, that sounds very elegant. Did you ever tell that a Smalltalk
programmer? He'll probably switch to C++ immediately <g>

Best regards

Stefan

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.