home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11306 < prev    next >
Encoding:
Text File  |  1992-07-21  |  2.3 KB  |  52 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mole-end!mat
  3. From: mat@mole-end
  4. Subject: Re: Novice? question: Designing for multiple inheritance w/ templates
  5. Message-ID: <1992Jul21.131054.20622@mole-end>
  6. Organization: :
  7. References: <1992Jul9.144630.10863@clpd.kodak.com> <1992Jul20.152931.8037@ucc.su.OZ.AU>
  8. Date: Tue, 21 Jul 1992 13:10:54 GMT
  9. Lines: 41
  10.  
  11. In article <1992Jul20.152931.8037@ucc.su.OZ.AU>, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  12. > In article <1992Jul19.233851.15525@mole-end> mat@mole-end writes:
  13. > >...  From what I can tell, virtual inheritance is principally useful
  14. > >for importing what might be called `object representation behavior,'
  15. > >e.g. printability, special allocation and deallocation, etc.--things
  16. > >that are related to the representation OF the object, rather than to
  17. > >what the object itself represents.
  18.  
  19. >     Quite the opposite I find. Its prinicple use is in 
  20. > deriving new abstractions from old. 
  21. >     A golden rule is : ALL ABSTRACT BASES SHOULD BE INHERITED
  22. > PUBLIC VIRTUAL.
  23. >     IMHO almost every public derivation ought to be virtual.
  24. > Public virtual derivation with abstract classes is used to
  25. > make a multi-faceted abstraction.
  26. >     Because the derivation is virtual, you can hook in implementations
  27. > of the various abstractions of combinations of them at the last minute:
  28. > late binding of implementation details.  These details [should] usually
  29. > be bound in to a class with local scope (or file scope) ... guaranteeing
  30. > all access is dependent on the abstract properties of the object only.
  31. >     This mechanism ... and guarrantees the run-time type of the object
  32. > can ONLY be be accessed via declared virtual functions.
  33.   ...
  34. >     A new optimisation technique (like caching) can be
  35. > hooked in, on an object by object basis, at construction time.
  36.  
  37. This is exactly what I was saying.  The thing added by Virtual MI is added
  38. not for the sake of what the class represents, but for the sake of the
  39. class representation.  It doesn't represent something in the problem
  40. domain and won't appear on an object-occurrence or class-relationship
  41. diagram.  Instead it provides something that belongs to the solution domain,
  42. to the properties of the programmatic object rather than the analysis
  43. object.
  44.  
  45. Or do I misunderstand you completely?
  46. -- 
  47.  (This man's opinions are his own.)
  48.  From mole-end                Mark Terribile
  49.  
  50.  uunet!mole-end!mat, Somewhere in Matawan, NJ
  51.