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: <3283BB94.2D82@concentric.net> (raw)
In-Reply-To: 55v177$ufo@grimsel.zurich.ibm.com


Paul_Gover@uk.ibm.com wrote:
> 
> In <328109CD.6685@concentric.net>, Alan Lovejoy <alovejoy@concentric.net> writes:
> > ...
> >The architecture and design of a program is a function of what **objects** it contains and
> >how they interact.  What classes these objects may or may not be instances of is a separate
> >issue--a fact which becomes obvious in a Self program, for example.  What matters is the
> >**interface** supported by each object, and the **role** each object plays in the program.
> >Note that two objects may support the same interface, but be instances of different
> >classes and/or play different roles.
> >
> >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.
> > ...
> 
> Alan, If you restrict your statements above to "architecture" or "analysis" I'd be in
> complete agreement.  However, I disagree when it comes to design; this might be a
> difference in our view of where to separate design from coding.  My view is that design
> includes implementation detail such as inheritance.  I most certainly consider that
> "OO development methods" should address it.

I think you've hit the nail on the head.  I do distinguish between "design" and "coding".

To me, the "design" of a program is a language-independent abstraction.  Implementation
inheritance is a coding issue.  It's about how to express the program in a programming
notation with the least amount of code duplication and/or the least amount of code changes
when requirements change.

> 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 implementation inheritance is overemphasized.  Many seem to think that the
class hierarchy **is** the design!  As I noted in another post: the same class hiearchy
may permit the specification of many different programs, each with a different 
architecture and design.

> 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.

Hey, I'm not saying that inheritance is not a good thing!  Far from it!  Yes, the "converted
program" has those problems, but I wasn't recommending that programs be coded that way, but
rather pointing out that they could be.  I was hoping that contemplation of that fact 
would illuminate the difference between design, class hiararchies and implementation
inheritance.

The issues that a design methodology should address with respect to implementation inheritance
would be questions such as the following:

* Just because two objects have the same behavior may or may not mean that they should
inherit the shared behavior.  The methodology should provide the guidance needed to
resolve this issue (is the fact that the behavior is the same simply accidental, or
does it depend upon some reliable invariant?  How likely is it that a changed requirement
will necessitate changing the behavior of one of the objects, but not the other?).

* When should delegation be used instead of inheritance?

* When should the Strategy pattern be used instead of inheritance?

However, implementation inheritance should be treated as a refinement of the design, not
as the body and soul of it.

--
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       ` 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-12  0:00       ` Alan Lovejoy
1996-11-06  0:00   ` Alan Lovejoy
1996-11-07  0:00     ` Piercarlo Grandi
1996-11-10  0:00       ` drs
1996-11-12  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-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 [this message]
     [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
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 ` Jon S Anthony
1996-11-08  0:00 ` Alan Lovejoy
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         ` Anthony Menio
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-08  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t 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