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

  1. Newsgroups: comp.lang.c++
  2. From: nikki@trmphrst.demon.co.uk (Nikki Locke)
  3. Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
  4. Subject: Re: On Trees vs. Forests.  was: Should I use a generic objec
  5. Reply-To: nikki@trmphrst.demon.co.uk
  6. Distribution: world
  7. X-Mailer: cppnews $Revision: 1.20 $
  8. Organization: Trumphurst Ltd.
  9. Lines: 20
  10. Date: Mon, 23 Nov 1992 13:07:29 +0000
  11. Message-ID: <722549249snx@trmphrst.demon.co.uk>
  12. Sender: usenet@gate.demon.co.uk
  13.  
  14. In article <rmartin.722279904@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
  15. > The tree model has the advantage that every object will inherit some
  16. > baseline functionality.  For example, every object may inherit the
  17. > ability to print standard debugging messages, or the ability to know
  18. > the name of its class.  Every object could inherit the ability to
  19. > Print or Dump or Gargle with salt water.
  20. ..
  21. > The disadvantages of the forest model are the lack of common paradigms
  22. > for dealing with the objects.  Each object may have a Print or Gargle
  23. > method, but there is no common abstract class which encapsulates that
  24. > ability.  Moreover, since reqularity is not enforced, Print and Gargle
  25. > may have different signatures and behave in different ways.
  26. This is what multiple inheritance is for ! The library should have classes
  27. Printable and Throat, with methods Printable::print, and Throat::Gargle. 
  28. Those classes which need to be printed inherit from Printable, and those 
  29. which have bad breath inherit from Throat.
  30.  
  31. -- 
  32. Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
  33. trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
  34.