From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,7f8fc37d854731d6 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,7f8fc37d854731d6 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,7f8fc37d854731d6 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,7f8fc37d854731d6 X-Google-Attributes: gid114809,public X-Google-Thread: 10461e,7f8fc37d854731d6 X-Google-Attributes: gid10461e,public From: nickt@bain.oz.au (Nick Thurn) Subject: Re: Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Date: 1996/11/08 Message-ID: <55u84o$k0i@plath.bain.oz.au>#1/1 X-Deja-AN: 195200202 references: <32813322.41C6@kyebek3.kjist.ac.kr> followup-to: comp.object,comp.lang.ada,comp.ai,comp.lang.c++,comp.lang.smalltalk organization: Bain & Company newsgroups: comp.object,comp.lang.ada,comp.ai,comp.lang.c++,comp.lang.smalltalk Date: 1996-11-08T00:00:00+00:00 List-Id: alovejoy@concentric.net wrote 06.11.96: > > Class inheritance is an abstraction mechanism for code sharing. > It has > nothing much to do with architecture or design of a program. > This is a dangerous notion! IMHO those who subscribe to this notion should work for "the opposition". :) So what pray tell *is* to do with architecture and design? > Proof: any > program using class inheritance can easily be converted into a completely > equivalent program where all the leaf classes are root classes: one simply > duplicates all the inherited methods in each leaf class. > This is wrong. It is not "simple" unless the translated program doesn't use polymorphis. Where it was used explodes to a mess of conditionals and special cases. Polymorphism moves complexity from class clients to the runtime. Your "proof" is bogus. An equivalent program cannot be mechanically produced by simply copying method implementations as *much* new code is required to deal with the dispatch of those methods. Think of a program with two sets of interacting objects. The OO version has two hierarchys each with a base abstraction that fully describes the behaviour of derived objects. The program must deal with two things only. Remove the polymorphism and what happens? The program must now deal with N things everywhere. The complexity increases exponentially with the number of new objects and all parts of the program are touched by any additional types. Nick (my opinions only)