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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: donh@syd.csa.com.au (Don Harrison) Subject: Re: To overload or not to overload (was Eiffel and Java + Ada dispatching) Date: 1996/11/08 Message-ID: #1/1 X-Deja-AN: 195208612 sender: news@syd.csa.com.au x-nntp-posting-host: dev11 references: organization: CSC Australia, Sydney reply-to: donh@syd.csa.com.au newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1996-11-08T00:00:00+00:00 List-Id: (A bit of explanation on my last post). I wrote: :I think the choice in Eiffel of making specialisations functionally equivalent :to their generalisations is the right one in terms of modelling integrity. By 'functionally equivalent to', I mean 'polymorphic wrt'. The issue of modelling integrity implies a pragmatic consideration as well. If specialisations reflect greater modelling integrity, you would also expect that specialised operations are what you would want to *use* (call) most of the time rather than general ones. It makes sense, then (to maximise the power of dynamic binding), for them to be polymorphic wrt the parent class. I don't have any data to back this up but it seems logical. (if someone can confirm this, please share it with us). If it's true that specialisations *are* the operations you want most often, then making the general (inherited) operations polymorphic means that dynamic binding is wasted on a minority of calls. I should also clarify the following. : ... So, Eiffel : dispatches to a more specific operation by default rather than to a more general : one. should read ... So, Eiffel dispatches to a more specific operation by default and does not inherit the more general parent operation. However, if you *do* want the parent operation as well, then you can repeatedly inherit it and leave one the same and specialise the other. This is where Eiffel is very flexible compared with Ada because you can nominate *either* the inherited (parent) operation *or* the specialised one to be polymorphic wrt the parent. and : So, Ada dispatches to a more general operation by default rather than to a : more specific one. ... should read So, Ada dispatches to the general (inherited) operation by default rather than to a more specific new one. ... Don. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison donh@syd.csa.com.au