This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Delegation in Java (A&S Footnote (Re: records))


Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE> writes:

> Per Bothner <per@bothner.com> writes:
> 
> > [...] multiple
> > interface inheritance combined with single implementation inheritance.
> 
> Where does the word "multiple interface inheritance" come from?

It is not a word, it is a phrase.  And I think it captures my meaning.

> AFAIK an interface implements association so that you can delegate a
> message for object a to another class' object b.

No, an interface specifies that a class or module should satisfy
certain properties, specifically that it must implement/export at
least the listed methods/values.  The term has mostly been used
when talking about module systems:  A module *implements* one or
more interfaces;  clients of the module can only access it via
an interface, and then can only use the properties specified in the
interface.  Java uses the term for someting similar but not quite
the same:  A Java interface is basically a pure abstract class
containing constant definitions, method propotypes, but no method
bodies.  (It corresponds to a C++ virtual abstract class with no
instance fields or non-abstract methods.)  In both cases an
interface is a specification of exported properties.

In Java, interfaces can be "extended" or inherited, and a class
can "implement" multiple interfaces. This corresponds to C++
multiple inheritance restricted to virtual abstract classes.

Delegation is not really involved in either use of the term "interface",
at least as I use the terms.
-- 
	--Per Bothner
bothner@pacbell.net  per@bothner.com   http://home.pacbell.net/bothner/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]