🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java
Article #12

Re: C++ and Java

#12
From: John D. Mitchell
Date: Tue, 10 Oct 1995 07:31
31 lines
1982 bytes
In article <45ceei$h3g@st-james.comp.vuw.ac.nz>,
Christopher Price <branzcgp@branz.org.nz> wrote:
[...]
>Many of the methodology gurus have stated (sorry I'm not chasing the 
>reference here) that single inheritence leads to poor design.

Note that this is clearly an oversimplified statement.  Poor design leads
to poor design.  Single inheritance may or may not be appropriate or
acceptable in a coding context (as opposed to analysis and/or design) but
that very much depends.  It also doesn't relate (directly) to Java.

First off, the 'methodology' folks are usually talking about modelling
(i.e., analysis & design) rather than coding (but who cares :-).  The big
thing is that they want control over the 'interfaces' which a class
implements and they most certainly want a single object to be able to
fulfill the contract promised by multiple interfaces.  C++ mingles the
concepts of interface versus implementation inheritance and so most people
don't distinguish (enough?) between the two.

The statement doesn't apply to Java since Java has made the clear
distinguishment of interface from implementation inheritance and while it's
true that you may only singly inherit implementation, you may adhere to
multiple interfaces.

BTW, if you want a language which distinguishes between implementation and
interface inheritance but allows for both single and multiple inheritance
in each case (along with lots of other nice features), check out Sather.
comp.lang.sather is a good place to start.

Take care,
	John
Technical Details
Message-ID: <45d7g5$8nk@mitchell.org>
Path: arc1-ca.pugleaf.net!mitchell.org!not-for-mail
References: <4535bv$cfr@susscsc1.rdg.ac.uk> <4565t8$u5q@hopi.gate.net> <30779340.64E4@gpu.srv.ualberta.ca> <45ceei$h3g@st-james.comp.vuw.ac.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mitchell.org!not-for-mail
From: johnm@mitchell.org (John D. Mitchell)
Newsgroups: comp.lang.java,comp.lang.c++
Subject: Re: C++ and Java
Date: 10 Oct 1995 00:31:17 -0700
Organization: Mitchell Research
Message-ID: <45d7g5$8nk@mitchell.org>
References: <4535bv$cfr@susscsc1.rdg.ac.uk> <4565t8$u5q@hopi.gate.net> <30779340.64E4@gpu.srv.ualberta.ca> <45ceei$h3g@st-james.comp.vuw.ac.nz>
NNTP-Posting-Host: 205.149.2.3