[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Curl, multiple inheritance, and interfaces (was Re: cheerful static typing)



   Date: Thu, 10 Jan 2002 14:16:20 -0500
   From: "Anton van Straaten" <anton@appsolutions.com>

   Christopher Barber wrote:
   >  - Curl supports multiple inheritance
   >    (and thus has no need for interfaces)

   Does Curl have some other way of declaring a contract independently from a
   specific implementation of that contract?  If not, then I would argue that
   there is still a need for interfaces (or an equivalent), despite the
   existence of multiple inheritance.

I agree that the motivation for an "interface" feature is orthogonal
to the motivation for multiple inheritance.  If Java were extended to
have multiple inheritance of class implementation, or unextended to
not have multiple inheritance of interfaces, it would still make sense
to have interfaces.

							     e.g. in Java, it's
   impossible to ignore interfaces

Well, I wouldn't describe Java with words that strong.  You could
imagine an alternative design in which every class must implement some
interface; that would make it impossible to ignore interfaces.  With
Java, you can have classes that do inheritance, and that have abstract
methods, without using Java interfaces.