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,436e4ce138981b82 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-19 11:37:55 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!cyclone.bc.net!sjc70.webusenet.com!news.usenetserver.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: abstract sub programs overriding Date: Fri, 19 Mar 2004 13:37:36 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <105mj0j126ie684@corp.supernews.com> References: <0ipr40thtf86b520a0qdi003aj87gtuhd4@4ax.com> <1078849973.701176@master.nyc.kbcfp.com> <1078924150.268074@master.nyc.kbcfp.com> <1078934469.744922@master.nyc.kbcfp.com> <1078949096.760629@master.nyc.kbcfp.com> <1079013337.572283@master.nyc.kbcfp.com> <9_mdnfzBlfEC3M_d4p2dnA@comcast.com> <1079361579.900651@master.nyc.kbcfp.com> <105f2jql5ge7f0a@corp.supernews.com> <105h3dkion79348@corp.supernews.com> <3vydndmUiYRplsTdRVn-sQ@comcast.com> <105ieithg52qo74@corp.supernews.com> <1079622255.263633@master.nyc.kbcfp.com> <105k1qt2i88gt1c@corp.supernews.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:6451 Date: 2004-03-19T13:37:36-06:00 List-Id: "Hyman Rosen" wrote in message news:teu6c.24872$1g2.18676@nwrdny02.gnilink.net... > Randy Brukardt wrote: > > (This presumes that Initialize isn't calling methods, but that is > > under the control of the programmer.) > > I think this brings us around full circle. In an inheritance hierarchy > which requires that Initialize methods call their parent's Initialize, > there is not just one programmer. The author of the derived class may > not know whether the base's Initialize will be calling methods, possibly > with dispatching. True, but re-dispatch (in the same type hierarchy) is an error in an Initialize or Finalize routine. It's one that isn't caught by Ada, but since you have to go out of your way to do it, it doesn't happen often. (Some people would go further and say that redispatch is always an error, but that is probably going too far. But it always should be avoided.) Besides, calling methods of the type in an Initialize routine is a dubious practice to begin with (because the object is not necessarily initialized properly). There's nothing new about this. In OOP, you always have to trust that your parent is implemented properly. If it isn't, there is nothing that you can do that will make an appropriate abstraction. The parent has to be fixed. Perhaps you can patch around it, but that doesn't change the fact that the *parent* is broken. Randy.