comp.lang.ada
 help / color / mirror / Atom feed
From: Alan Lovejoy <alovejoy@concentric.net>
Subject: Re: Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools)
Date: 1996/11/08
Date: 1996-11-08T00:00:00+00:00	[thread overview]
Message-ID: <32838D59.6462@concentric.net> (raw)
In-Reply-To: 55vfg3$513@news3.digex.net


Ell wrote:
> 
> Paul_Gover@uk.ibm.com wrote:
> : In <328109CD.6685@concentric.net>, Alan Lovejoy <alovejoy@concentric.net> writes:
> : >Class inheritance is an abstraction mechanism for code sharing.  It has nothing much to do
> : >with architecture or design of a program.  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.
> : > ...
> 
> : I think from your statement about converting to equivalent programs indicates you
> : consider implementation to be outside the scope of the design (since you describe two
> : different implementations for the same design); in that case, do you think that
> : questions of inheritance and so forth are not part of the development method?
> : I think this is dangerous; in your example, the coverted program has large amounts of
> : duplicated code, so making changes is harder because the programmer has to find all
> : occurrences of the duplicated code, and we have lost one of the benefits of OO.
> 
> I agree with you that inheritance should be more than a means of code
> sharing.  But it seems he is saying we can take all of the methods
> declared and defined along the branch of an inheritance hierarchy and
> aggregate them in root classes.  Perhaps he will clarify.

I am saying that all classes could be root classes--that is, one can have classes 
and objects without inheritance, and construct objects and programs that have exactly 
the same functionality as those that use inheritance.  The only difference is the amount 
of code that must be written, and the effort required to make certain changes in the 
program.

The point is that whether or not one uses inheritance does not change the **design** 
of the program at the architectural level at which a design methodology should concern 
itself (although using or not using inheritance can be said to be a difference in design, 
it is a physical implementation difference, not an architectural difference).  Using
inheritance versus duplicating code does not in itself change what an object or program 
does.

Consider an argument from the opposite direction:  One can construct many very different
programs using the very same class library.  Let's say the class library has 26 leaf classes,
named A through Z.  One program can be started by instantiating an instance of class M,
and then sending it the message "startUpProgram1."  Another program can be started by
instantiating an instance of class C, and sending it the message "doSomeStuff."   Either
program may instantiate objects of any class (A through Z), and send whatever messages
such instances will understand. The set of possible programs in this situations is
a function of what messages can be understood by which objects, and what each method
does.  The inheritance hierarchy used to povide each object with a set of messages it
can understand makes no difference.

If the same class hierarchy can be used to create many different programs (without
defining any new classes or methods), then it should be obvious that the class 
inheritance hierarchy and program architecture and design are not at all the same 
things!

--
Alan L. Lovejoy		|==============================================| 
Smalltalk Consultant	|	Beware of Geeks bearing GIFs!	       |
alovejoy@concentric.net |==============================================|




  reply	other threads:[~1996-11-08  0:00 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-06  0:00 Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) Dong Oh Kim
1996-11-06  0:00 ` Paul_Gover
1996-11-06  0:00   ` Jan Steinman
1996-11-07  0:00     ` Paul_Gover
1996-11-12  0:00     ` Robert C. Martin
1996-11-12  0:00       ` Alan Lovejoy
1996-11-12  0:00       ` Snowball
1996-11-15  0:00         ` Soren Skogstad Nielsen
1996-11-28  0:00         ` Piercarlo Grandi
1996-11-28  0:00         ` Piercarlo Grandi
1996-11-06  0:00   ` Alan Lovejoy
1996-11-07  0:00     ` Piercarlo Grandi
1996-11-10  0:00       ` Vlastimil Adamovsky
1996-11-11  0:00         ` Piercarlo Grandi
1996-11-11  0:00           ` Anthony Menio
1996-11-18  0:00             ` Piercarlo Grandi
1996-11-20  0:00               ` Anthony Menio
1996-11-27  0:00                 ` Piercarlo Grandi
1996-11-12  0:00           ` Anthony Menio
1996-11-18  0:00             ` Piercarlo Grandi
1996-11-19  0:00               ` Anthony Menio
1996-11-27  0:00                 ` Piercarlo Grandi
1996-11-10  0:00       ` drs
1996-11-12  0:00         ` Piercarlo Grandi
1996-11-11  0:00       ` Daniel Drasin
1996-11-12  0:00         ` Anthony Menio
1996-11-08  0:00     ` Paul_Gover
1996-11-08  0:00       ` Alan Lovejoy
     [not found]         ` <6KZQfjK-3RB@herold.franken.de>
1996-11-10  0:00           ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Chris
1996-11-10  0:00             ` Vlastimil Adamovsky
1996-11-11  0:00         ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) Bill Gooch
1996-11-12  0:00           ` Alan Lovejoy
1996-11-13  0:00             ` Nick Thurn
1996-11-13  0:00             ` Ell
1996-11-14  0:00             ` Bill Gooch
1996-11-19  0:00               ` Tim Ottinger
1996-11-12  0:00           ` Jan Steinman
1996-11-12  0:00             ` Alan Lovejoy
1996-11-13  0:00               ` Nick Thurn
1996-11-13  0:00                 ` Alan Lovejoy
1996-11-14  0:00                   ` Nick Thurn
1996-11-08  0:00       ` Ell
1996-11-08  0:00         ` Alan Lovejoy [this message]
1996-11-13  0:00           ` Ell
1996-11-10  0:00       ` vlad
1996-11-12  0:00     ` Robert C. Martin
1996-11-12  0:00       ` Alan Lovejoy
1996-11-14  0:00         ` David N. Smith
1996-11-14  0:00           ` Bill Gooch
1996-11-20  0:00         ` Robert C. Martin
1996-11-20  0:00           ` Michael Malak
1996-11-20  0:00             ` Robert Dewar
1996-11-20  0:00           ` Robert Dewar
1996-11-26  0:00           ` Tucker Taft
1996-12-03  0:00             ` Robert C. Martin
1996-12-08  0:00               ` Tucker Taft
1996-11-06  0:00   ` Snowball
1996-11-13  0:00     ` Peter Pflaum
1996-11-13  0:00       ` David N. Smith
1996-11-07  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Joachim Durchholz
1996-11-08  0:00   ` Richard A. O'Keefe
1996-11-09  0:00     ` Piercarlo Grandi
1996-11-13  0:00       ` Richard A. O'Keefe
1996-11-27  0:00         ` Piercarlo Grandi
1996-11-08  0:00 ` Alan Lovejoy
1996-11-08  0:00 ` Jon S Anthony
1996-11-08  0:00 ` Nick Thurn
1996-11-08  0:00   ` Alan Lovejoy
1996-11-11  0:00     ` Nick Thurn
1996-11-11  0:00       ` Paul_Gover
1996-11-11  0:00         ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) David N. Smith
1996-11-12  0:00           ` Anthony Menio
1996-11-11  0:00         ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Anthony Menio
1996-11-08  0:00 ` Joachim Durchholz
1996-11-12  0:00   ` Alaric B. Williams
1996-11-13  0:00   ` Richard A. O'Keefe
1996-11-11  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) Cesar A. Gonzalez Perez
1996-11-12  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Joachim Durchholz
1996-11-20  0:00   ` Piercarlo Grandi
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox