"Inheritance considered harmful"

james anderson James.Anderson at mecom.mixx.de
Fri Apr 3 05:03:25 BST 1998


John Tigue wrote:

> A note and a question.
>
> Note though that in Java (and seemingly in COM+) there are two types of
> interitance. There are the notions of superInterface and superClass.

the first is subtyping. the second is inheritance. they are kept distinct
because the designers considered the  multiple inheritance to be an "evil", so
they permit only multiple subtyping.

> ...
>
> The question: While class inheritance does not map to Architectural forms,
> does interface inheritance map to Architectural forms?
>

as Paul Prescod noted, yes, the aspect which does subtyping is analogous to
interfaces.on the other hand, i had understood architectural attribute
definitions to apply to the derived element and thus to be effecting
inheritance.

so both notions map; the first to "architectural forms" and the second to
"architectural attributes".

> >>> That's probably because the architecture facility of ISO/IEC 10744
> doesn't
> >>> *do* inheritance in the way that most people seem to expect.
> >>
> >>That's right. That's why people get so confused about them. The word
> >>inheritance is inherently misleading when applied to architectural forms.
> >>
> >>Architectural forms do subtyping, not inheritance. Inheritance is about
> >>"getting stuff for free"  (e.g. code, declarations, fields). Subtyping is
> >>about *fulfilling a particular role* (perhaps through a manual
> >>construction of an appropriate "interface" (in this case a content
> >>model)). Architectural forms allow you to specify an interface that must
> >>be fulfilled and declare conformance to that interface. It does not allow
> >>you to "get code for free" (i.e. markup declarations).
> >
> >Paul has made clear what I was feebly trying to say: thanks Paul.
> >
> >Cheers,
> >
> >E.


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list