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: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public From: nospam@thanks.com.au (Don Harrison) Subject: Re: Interface/Implementation (was Re: Design by Contract) Date: 1997/09/02 Message-ID: #1/1 X-Deja-AN: 269510160 Sender: news@syd.csa.com.au References: Reply-To: nospam@thanks.com.au X-Nntp-Posting-Host: dev50 Organization: CSC Australia, Sydney Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-09-02T00:00:00+00:00 List-Id: Patrick Doyle wrote: :In article , :Jon S Anthony wrote: :>In article doylep@ecf.toronto.edu (Patrick Doyle) writes: :> :>> >More to the point: not _relevant_ in the Ada case as this is handled :>> >by a different orthogonal capability Agree. Multiple, polymorphic implementations are provided by deferred classes and abstract types in Eiffel and Ada respectively. As Jon says, this is an orthogonal concept to interfaces. :>> >(instead of conflating it with module as in Eiffel). This is a different issue. :>> using a deferred class is more powerful than a simple interface :>> file, and can accomplish all the same things, so why split :>> this into two concepts? Because they serve different purposes. (See my previous post). : The Deja News suggestion is a good idea. I'll take a look there :when I get a moment. You could, but you may get more confused. :( Try thinking along the lines of a) Ada interfaces correspond to Eiffel short forms, and b) Ada abstract types correspond to Eiffel deferred classes. In terms of b), the Ada (corrections welcome): package P is type T is abstract tagged private; procedure Do_Something (X: T) is abstract; -- deferred/abstract private type T is tagged record Y: Integer; end record; end; is basically equivalent to the Eiffel: deferred class T feature do_something is deferred end -- deferred/abstract feature {NONE} y: INTEGER end. Deriving effective (concrete) descendants from these, we might have the Ada: with P; package Q is type New_T is new P.T; procedure Do_Something (X: T); end; package body Q is procedure Do_Something (X: T) is begin .. end; -- effective end; and the corresponding Eiffel: deferred class NEW_T inherit T feature do_something is do .. end -- effective end. :>> And, as far as the class-as-module approach in Eiffel goes, I :>> once thought this was a bad idea too, but I'm not so sure any :>> more. Do you have some arguments against it? :> :>Tons. See DejaNews... Whether or not they convinced anyone is another matter, however. Don. (Reverse to reply) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison au.com.csa.syd@donh