From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: About 0Y interfaces
Date: Tue, 18 Oct 2005 17:01:32 -0500
Date: 2005-10-18T17:01:32-05:00 [thread overview]
Message-ID: <A6KdnXpRrONX8sjeRVn-qA@megapath.net> (raw)
In-Reply-To: 43552495.2050300@obry.net
"Pascal Obry" <pascal@obry.net> wrote in message
news:43552495.2050300@obry.net...
> Alex,
>
> > Firstly, interfaces are purely abstract, right? There's no way to
> > provide a default/partial implementation except creating an object type
> > which implements that interface.
>
> Right.
Correct. Interfaces are cheaper than full multiple inheritance, because
nothing concrete comes from them. You cna almost think of them as a
"property" of a tagged type -- it either has the interface (and thus
promises to have implementations of the primitive operations of the type) or
it doesn't.
> > Secondly, we can create an object type which implements two or more
> > interfaces.
>
> Right.
>
> > But I guess there's no multiple inheritance from classes, so
> > you couldn't use two implementations of two different interfaces
> > directly when creating a new type.
>
> There is no notion of interface implementation. Interfaces are inherited
> by a tagged object and implemented at this point.
You mean "tagged type". They also can be implemented by a task type or a
protected type. In all cases, the concrete operations either or are declared
at this point, or (in the case of a tagged type) are inherited from the
parent.
Personally, I find implementation inheritance to be more useful than
interface inheritance, but obviously others feel differently. And, in any
case, interfaces allow using OOP with tasks and protected types, which
wasn't a possibility in Ada 95.
Randy.
next prev parent reply other threads:[~2005-10-18 22:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-18 12:49 About 0Y interfaces Alex R. Mosteo
2005-10-18 13:18 ` Dmitry A. Kazakov
2005-10-18 14:34 ` Alex R. Mosteo
2005-10-18 16:54 ` Dmitry A. Kazakov
2005-10-18 16:36 ` Pascal Obry
2005-10-18 22:01 ` Randy Brukardt [this message]
2005-10-19 9:08 ` Brian May
2005-10-19 21:51 ` Randy Brukardt
2005-10-20 6:44 ` Alex R. Mosteo
2005-10-19 9:11 ` Pascal Obry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox