home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!batcomputer!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Why is C++ not considered a true OOL?
- Message-ID: <1993Jan27.152506.20935@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <24656@alice.att.com> <1993Jan21.005415.2812@ucc.su.OZ.AU> <ANDY.93Jan22102931@elviss.eng.sun.com>
- Date: Wed, 27 Jan 1993 15:25:06 GMT
- Lines: 50
-
- In article <ANDY.93Jan22102931@elviss.eng.sun.com> andy@elviss.eng.sun.com (Andrew Davidson) writes:
- >In article <1993Jan21.005415.2812@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- >
- >>
- >>The fourth alternative (mixins) is superior :-)
- >>
- >>....
- >>
- >>...
- >>
- >>But your greatest achievement, Bjarne, in my opinion,
- >>was the name dominance rule, because, coupled with virtual
- >>bases and abstract classes that enables mixins.
- >>
- >
- >what are mix ins?
- >
- So many people have asked that I'm preparing an answer
- and some examples. Sorry, its not ready yet.
-
- Briefly one way to do mixins:
- I declare some 'Axiom' classes with various
- interfaces---most of the functions are pure virtual.
-
- I use Multiple Virtual Inheritance to merge several
- of these classes to form a new abstraction. I can also
- add new functions defined in terms of the base pure virtuals.
- One might call these 'Theorem' classes. They are the user
- interface classes.
-
- The Axioms are useless without implementations.
- So I define various implementations that might be useful:
- these are the 'Model' classes.
-
- Finally, I mix up an implementation of my chosen abstraction
- be just virtual derivation from the Model classes that I want: some
- will be chosen for speed, other for compactness.
-
- The exact mix of implementation is irrelevant after
- the object is constructed: the object is always known
- statically by its 'Theorem' name. Implementation details
- are hidden, polymorphism does virtual function calls
- via from Theorem via the base Axioms and into the
- Models (called 'sibling call').
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;------ SCIENTIFIC AND ENGINEERING SOFTWARE ---ph: 2 799 8223 --------
-