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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e9c183f3911c2d73 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.202.168 with SMTP id kj8mr4263617pbc.1.1334385687920; Fri, 13 Apr 2012 23:41:27 -0700 (PDT) Path: r9ni54338pbh.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Dynamic binding Date: Sat, 14 Apr 2012 09:41:25 +0300 Organization: Tidorum Ltd Message-ID: <9uskglFbmqU1@mid.individual.net> References: <32a3d08f-7b48-46e2-b8cf-004acb6e40a3@d4g2000vbn.googlegroups.com> <55tfbsnll3t0$.1hx68o0qdhb90$.dlg@40tude.net> Mime-Version: 1.0 X-Trace: individual.net Qwmr+pzzGJahPO6dGN+6Sw6hpwQGPmaaTYhANWfrThjiozjaKf Cancel-Lock: sha1:jaj42uiUH6zHgvEc502E73sT2xw= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 In-Reply-To: <55tfbsnll3t0$.1hx68o0qdhb90$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-04-14T09:41:25+03:00 List-Id: On 12-04-13 23:55 , Dmitry A. Kazakov wrote: > On Fri, 13 Apr 2012 13:13:17 -0700 (PDT), Katarina Olsson wrote: > >> I have a question about dispatching in Ada. As we know, methods in >> java are always called on their objects. Let say that we have a class >> Parent with methods a() and b(), where a calls b like this: >> >> class Parent{ >> >> public void a() { >> System.out.println("parent a"); >> b(); >> } As Dmitry explained, in Java the call b() (re)dispatches, while in Ada is does not; if you want redispatch in Ada, you must ask for it by using a class-wide type. Dmitry explained well the Ada alternatives. However, not all Ada users agree with Dmitry's view that redispatching is unsafe. I often use redispatching to get the behaviour I want. Of course, the user of an operation must be aware of which operations use redispatching, so redispatching behaviour must be documented in the descriptions of the operations. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .