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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7ee10ec601726fbf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-30 18:13:32 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Questions - Polimorphism/Dynamic Binding Date: Tue, 30 Oct 2001 21:16:42 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:15458 Date: 2001-10-30T21:16:42-05:00 List-Id: "Eric Merritt" wrote in message news:mailman.1004483142.1667.comp.lang.ada@ada.eu.org... > Good explaination but, there is one aspect that is > missing. One of the benifits of Java Interfaces is > that it allows a form of quasi-multiple inheritance. > What I mean is that it will still allow you to inherit > from a root class and implement multiple interfaces. > In this case and interface almose becomes a kind of > agreement between the two bits of code the provider > agreeing to provide certain methods. How does my example fail to do this? The whole point of an interface type is that you have some operation that operates on any object that conforms to that interface, for example: procedure Do_Something (O : in P.T'Class); -- accepts the "interface" type P.T Using the schema I showed, you can call Do_Something on objects of Q.T: declare O : Q.T; begin Do_Something (O.I); end; No, you can't pass object O directly --you have to pass O.I-- but so what? This is only a syntactic matter. I'm still able to call Do_Something, which is all I care about. > I think this is > fairly easy to work around with a little forsight, > there is allways the delegation pattern for multiple > inheritance and that of course works in ada quite > well. The distinction between delegation and inheritance is not very important to me.