From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,20144c9b38aef82d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Oct 2005 16:57:30 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <4354EF40.9010906@mailinator.com> <43552495.2050300@obry.net> Subject: Re: About 0Y interfaces Date: Tue, 18 Oct 2005 17:01:32 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-wCyEkuX+zMTOza2TF+8YX3aETLI71Q/fqT/0g+/uLffkZHMoV16fv0M1vn+IL6VCvSUxK0KYcw0Gixv!NADSFRGQ7v2w8z1yGJnrvwpHKPTCgA6FDuIHvpgQhGHfGTu0Bw5SotOCqhfDETUih/G6PH74jomg X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:5787 Date: 2005-10-18T17:01:32-05:00 List-Id: "Pascal Obry" 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.