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