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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ecfc0548c2df0d76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-06 10:05:03 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: MI ammunition : linked lists Date: Thu, 6 Nov 2003 18:16:35 +0100 Organization: Adalog Message-ID: References: NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1068141777 9262 195.25.228.57 (6 Nov 2003 18:02:57 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 6 Nov 2003 18:02:57 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:2160 Date: 2003-11-06T18:16:35+01:00 List-Id: "amado.alves" a �crit dans le message de news:mailman.293.1068136383.25614.comp.lang.ada@ada-france.org... >A very common programming task where multiple inheritance (MI) would be >handy: implementation of doubly linked lists. [snip] > type Middle_Node is new First_Node with Last_Node; I would take this as a typical example of abuse of MI. Inheritance should reflect an "is a" relationship. Do you fill comfortable stating that a middle node is a first node and a last node at the same time? >But, semantically, MI would allow conversions between Middle_Node and any the other two extended types. >Whether this would be useful for linked lists remains to be ascertained. I confess I have not implemented them this >way yet. So you trade checking a null value for checking a node belonging to a certain class, with a number of extra conversions required.... My advice would be: use MI (and SI as well) IF AND ONLY IF it makes things simpler. Don't bother if people tell you that you are not "purely object oriented" ;-) -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr