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,b7bb302ee9d32439,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-18 02:01:17 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!eusc.inter.net!news.eusc.inter.net!boavista.snafu.de!news From: Michael Erdmann Newsgroups: comp.lang.ada Subject: Q: Refactorizing code because Inheritance and Interfaces Date: Sat, 18 Oct 2003 11:10:32 +0200 Organization: gnade.sourceforge.net Message-ID: <8lc761-u81.ln1@boavista.snafu.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.eusc.inter.net 1066467676 2604 213.73.71.231 (18 Oct 2003 09:01:16 GMT) X-Complaints-To: abuse@eusc.inter.net User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:1113 Date: 2003-10-18T11:10:32+02:00 List-Id: Dear all, again i got a problem with inheritance. Lets assume the following situation, that you have made a nice package reading in xml files. The specification contains something like this: package XML_Reader is . type Object is new Sax.... with ... bla... procedure X(This : in out Object......) Some weeks later i have realized that this implemenation is nice, but it is part of a generalization: package Abtract_Reader is type Object is abstract tagged null record; type Handle is access all Object'Class; procedure X(.... ) is abstract; In order to line up the implemenation of the XML_Reader with the Abstract_Reader interface i need to rewrite the complete XML_Reader. Is there any way to avoid such situations? Regards M.Erdmann PS: In java i would use constructs as implements Sax..,Abstract_Reader.