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

Re: XML Schema equivClass.

  • From: Steve Harris <sharris@p...>
  • To: xml-dev@x...
  • Date: 03 Feb 2000 08:27:58 -0800

xml schema equivclass
Stefan Haustein <haustein@k...> writes:

[...]

> 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.

> So you need explicit pointers to make really use of inheritance.

Or references. It's only a matter of writing the proper function signatures.

> But with pointers, you cannot really use the STL (no wonder if you
> read what the STL author thinks of OOP). So you also need some
> wrapper classes....

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.

Stepanov is not out to block active use of OOP; he's just saying that
he doesn't find it to be the panacea most claim it is [1]. There was a
long and healthy discussion about this on comp.lang.c++.moderated in
November 1999 [2].

[1] http://www.cis.umassd.edu/~asanchez/gp/Edizioni-Infomedia.html
[2] http://deja.com/[ST_rn=ps]/viewthread.xp?AN=546022206&search=thread&svcclass=dnyr&ST=PS&CONTEXT=949594960.798294044&HIT_CONTEXT=949594960.798294044&HIT_NUM=24&REDO=1&recnum=%3c806oci$1jn$1@n...%3e%231/1&group=comp.lang.c%2b%2b.moderated&frpage=getdoc.xp

-- 
Steven E. Harris
Primus Knowledge Solutions, Inc.
http://www.primus.com

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.