home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!gossip.pyramid.com!pyramid!infmx!cshaver
- From: cshaver@informix.com (Craig Shaver)
- Newsgroups: comp.lang.c++
- Subject: Re: Should I use a generic object which all others inherit from
- Message-ID: <1992Nov19.165529.23862@informix.com>
- Date: 19 Nov 92 16:55:29 GMT
- References: <1992Nov17.190821.18348@informix.com> <5232@holden.lulea.trab.se>
- Sender: news@informix.com (Usenet News)
- Organization: Informix Software, Inc.
- Lines: 60
-
- In article <5232@holden.lulea.trab.se> jbn@lulea.trab.se (Johan Bengtsson) writes:
- >cshaver@informix.com (Craig Shaver) writes:
- >: In article <3762@news.cerf.net> hlf@nic.cerf.net (Howard Ferguson) writes:
- ....... blah blah blah
- >: performance go all the way and use the tree approach as pioneered by
- ........ blah blah blah
- >:
- >: One of the big wins of OOP is reuse. By using an inheritance structure
- >: you can reuse existing code and do incremental development. Related and
- >: unrelated classes can be used in the same context where a similar protocol
- >: is enforced.
- >
- >Perhaps you would then kindly enlighten the rest of us:
-
- OK!
-
- >
- >If I go for the tree approach, with a base class MyObject inherited
-
- YourObject is worthless, just use MyObject....
-
- >by all my classes, how am I going to reuse _your_ classes, which all
- >inherit from class YourObject? Multiple inheritance? What
-
- Use delegation instead of MI ...
-
- >if the protocol of my base class conflicts with your base class?
- >How do I reuse tree-type libraries from several sources, each with
- >it's own base class protocol?
-
- You don't! C++ bites it bigtime because of a lack of the one thing
- that would really make it good -- a standard base class library.
-
- >
- >Enforcing a common protocol (by inheritance) for all your classes,
- >_hampers_ reuse of your classes by anyone except yourself.
-
- Hold on there pardner! Start your own branch if you don't like mine.
- Trim the damn tree, make sure you have access to all source for classes.
- This statement sounds bogus. What is your point?
-
- >
- >Once a reference to an object has been passed as a generic
- >object reference, for example into a collection, how do you (safely)
- >call the actual methods of the objects (derived) class?
- >
- >--
- >--------------------------------------------------------------------------
- >| Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden |
- >| Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490 |
- >--------------------------------------------------------------------------
-
- Soooooo, give me your rebuttal in terms of flat class hierarchy and let me
- attack you. Templates are useless and should be removed from the language.
-
- Craig.......
-
- --
- Craig Shaver (cshaver@informix.com for now) (415)390-0654 (415)926-6407
- Productivity Group POB 60458 Sunnyvale, CA 94088
-