home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16567 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.8 KB  |  48 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!boulder!happy.colorado.edu!srheintze
  3. From: srheintze@happy.colorado.edu
  4. Subject: Wanted: Real Example of MI
  5. Message-ID: <1992Nov19.101210.1@happy.colorado.edu>
  6. Lines: 35
  7. Sender: news@colorado.edu (The Daily Planet)
  8. Nntp-Posting-Host: happy.uccs.edu
  9. Organization: University of Colorado, Boulder
  10. Date: 19 Nov 92 10:12:10 MDT
  11. Lines: 35
  12.  
  13. I am revising a course on C++.  I have been looking for some examples of
  14. multiple inheritance for some time now.  I look thru the plethora of C++ books
  15. at the local book stores and so far, I have yet to encounter one that has a
  16. good example of multiple inheritance.
  17.  
  18. Most of the x+++
  19.  
  20. I am revising a course on C++.  Specifically I want to enhance the section on
  21. multiple inheritance (MI) and I am having trouble comming up with appropriate
  22. examples. The only examples I can think of require a lot of domain knowledge. I
  23. regularly peruse the plethora of C++ books at the local book stores and have
  24. yet to find a satisfactory example of MI (Apparently others are having a
  25. difficult time of MI examples too). Most of the examples are    either
  26.  
  27.     purely syntactic (e.g.: class D: public B1, B2{...};)      
  28.  
  29.     or semantically non-sensical (e.g.: class TimeStamp : public
  30.     Clock, public Date{...};).     
  31.  
  32.     or trivial (class Panda : public Racoon, public Bear {...};)
  33.     Give me a real example of when this would be used in a real
  34.     application! If it was an application for a Zoo database,
  35.     feeding times, feeding amounts and other
  36.     requirements (i.e., data members and function
  37.     members) would
  38.     not be inherited from Raccoons and Bears. 
  39.     (See Tom Cargill's Book "C++ Programming
  40.     Style" for a good discussion of this common flaw - page
  41.     212).
  42.  
  43. Can any one give me a reasonable example of MI that is
  44. semantically consistent, concise and short AND REAL?     
  45.  
  46.     Thanks,    
  47.             Sieg
  48.