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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d9f3074dc2c4699 X-Google-Attributes: gid103376,public From: bbalfour@std.caci.com (Brad Balfour) Subject: Re: How to overload assignment in Ada 95? Date: 1996/12/11 Message-ID: #1/1 X-Deja-AN: 203555867 distribution: usa references: <58aclh$ssd@gaia.cc.gatech.edu> <1996Dec10.143635.1@eisner> organization: CACI, Inc. newsgroups: comp.lang.ada Date: 1996-12-11T00:00:00+00:00 List-Id: In article <1996Dec10.143635.1@eisner>, kilgallen@eisner.decus.org (Larry Kilgallen) wrote: >In article , bbalfour@std.caci.com (Brad Balfour) writes: >> However, one conclusion has become fairly obvious in retrospect. If >> overridings of Adjust, Finalize and Initialize are provided in the visible >> part, then it is possible for clients to call them directly -- a situation >> that is *not* desireable. As was pointed out by someone else, I was confusing two different issues when I wrote this and I am clearly incorrect. Where the overriding occurs doesn't change the possiblity of calling the operations from client packages. Sorry. In article <1996Dec10.143635.1@eisner>, kilgallen@eisner.decus.org (Larry Kilgallen) wrote: >If a further derivation is made from the type, and Adjust, Finalize >or Initialize must be overridden by that further derivation, shouldn't >that code call the parental versions to take care of what the parent >knows about ? Or is this a case where child packages _must_ be used ? It won't matter. The case we are discussing derives the new type in the visible part of the package. Since the type is known to be a decendent of Ada.Finalization.Controlled, the operations can be called. Where they are overriden is irrelevant. If the new type were defined as tagged private and only derived from A.F.C in the private part, then any further derivation that wanted to call on the operations inherited from A.F.C would have to be located in a child package. FWIW, I happen to like the style which mirrors the inheritance hierarchy in the child package hierarchy. Brad -- Brad Balfour SIGAda WWW Server CACI, Inc. http://www.acm.org/sigada/ (703) 277-6767 and also try: bbalfour@std.caci.com http://www.adahome.com/ 3930 Pender Drive Fairfax, VA 22030 "...they even have have rules on exceptions" -- Dewar and Schonberg