W3C home > Mailing lists > Public > www-di@w3.org > November 2005

[DCI] Multiple inheritance of interfaces

From: L. David Baron <dbaron@dbaron.org>
Date: Sun, 20 Nov 2005 12:32:21 -0800
To: www-di@w3.org
Message-ID: <20051120203221.GA8683@ridley.dbaron.org>
I notice that the DCIProperty interface defined in [1] uses multiple
inheritance.

None of the DOM WG specs use multiple inheritance of interfaces because,
as I understand it, the DOM WG decided that avoiding multiple
inheritance was a valuable invariant to maintain.  Invariants, including
this one, are useful in keeping implementations simple.  This break with
the convention can also make your interface impossible to implement
correctly in some bindings, such as those that depend on COM or XPCOM,
which was probably an important use case when the DOM WG decided not to
use multiple inheritance of interfaces.  (Those bindings, in turn, may
rely on single inheritance to simplify function calls between
languages.)

Working groups should not break the invariants established by other
groups:  doing so leads the Web down a path towards higher
implementation complexity and thus lower reliability.  It also often
leads to the worst of both worlds (many interfaces give up the
advantages of multiple inheritance, while implementations still have to
deal with the extra complexity for the handful that broke the rules).

-David

[1] http://www.w3.org/TR/2005/WD-DPF-20051111/#sec-appendix-a

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Sunday, 20 November 2005 20:32:42 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.30 : Sunday, 20 November 2005 20:32:46 GMT