home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!boulder!happy.colorado.edu!srheintze
- From: srheintze@happy.colorado.edu
- Subject: Wanted: Real Example of MI
- Message-ID: <1992Nov19.101210.1@happy.colorado.edu>
- Lines: 35
- Sender: news@colorado.edu (The Daily Planet)
- Nntp-Posting-Host: happy.uccs.edu
- Organization: University of Colorado, Boulder
- Date: 19 Nov 92 10:12:10 MDT
- Lines: 35
-
- I am revising a course on C++. I have been looking for some examples of
- multiple inheritance for some time now. I look thru the plethora of C++ books
- at the local book stores and so far, I have yet to encounter one that has a
- good example of multiple inheritance.
-
- Most of the x+++
-
- I am revising a course on C++. Specifically I want to enhance the section on
- multiple inheritance (MI) and I am having trouble comming up with appropriate
- examples. The only examples I can think of require a lot of domain knowledge. I
- regularly peruse the plethora of C++ books at the local book stores and have
- yet to find a satisfactory example of MI (Apparently others are having a
- difficult time of MI examples too). Most of the examples are either
-
- purely syntactic (e.g.: class D: public B1, B2{...};)
-
- or semantically non-sensical (e.g.: class TimeStamp : public
- Clock, public Date{...};).
-
- or trivial (class Panda : public Racoon, public Bear {...};)
- Give me a real example of when this would be used in a real
- application! If it was an application for a Zoo database,
- feeding times, feeding amounts and other
- requirements (i.e., data members and function
- members) would
- not be inherited from Raccoons and Bears.
- (See Tom Cargill's Book "C++ Programming
- Style" for a good discussion of this common flaw - page
- 212).
-
- Can any one give me a reasonable example of MI that is
- semantically consistent, concise and short AND REAL?
-
- Thanks,
- Sieg
-