home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!rat!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!news
- From: ezachris@iroquois.ucs.indiana.edu
- Newsgroups: comp.lang.c++
- Subject: Multiple Inheritance - Necessary?
- Keywords: c++ inheritance
- Message-ID: <By17An.4uH@usenet.ucs.indiana.edu>
- Date: 20 Nov 92 20:23:11 GMT
- Sender: news@usenet.ucs.indiana.edu (USENET News System)
- Organization: Indiana University
- Lines: 32
- Nntp-Posting-Host: iroquois.ucs.indiana.edu
-
-
- Hello!
-
- A friend of mine who programs in Objective-C argues that multiple
- inheritance is unnecessary and complicated.
-
- Let's say you have a pencil-object and an eraser-object and to create a
- pencil-with-an-eraser-on-it you'd inherit from both the pencil and the
- eraser object, right?
-
- Like this:
-
- PENCIL ERASER
- ^ ^
- \ /
- \ /
- PENCIL-WITH-ERASER
-
- My Objective-C friend would make a new object "Pencil-with-eraser" that
- would declare two objects inside it.
-
- Like this:
-
- PENCIL-WITH-ERASER
- Eraser TheEraser(...);
- Pencil ThePencil(...);
-
- To implement the functionality of the pencil and the eraser he'd write a
- bunch of functions that call the functions inside the pencil and the
- eraser objects.
-
- I think this sounds like hogwash. What do you think?
-