comp.lang.ada
 help / color / mirror / Atom feed
From: bbalfour@std.caci.com (Brad Balfour)
Subject: Re: How to overload assignment in Ada 95?
Date: 1996/12/11
Date: 1996-12-11T00:00:00+00:00	[thread overview]
Message-ID: <bbalfour-1112961505130001@stmac0088.std.caci.com> (raw)
In-Reply-To: 1996Dec10.143635.1@eisner


In article <1996Dec10.143635.1@eisner>, kilgallen@eisner.decus.org (Larry
Kilgallen) wrote:
>In article <bbalfour-1012961302000001@stmac0088.std.caci.com>,
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




  reply	other threads:[~1996-12-11  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-06  0:00 How to overload assignment in Ada 95? Christopher D Carothers
1996-12-07  0:00 ` Robert Dewar
1996-12-09  0:00 ` Brad Balfour
1996-12-09  0:00   ` Matthew Heaney
1996-12-10  0:00     ` Robert A Duff
1996-12-10  0:00     ` Brad Balfour
1996-12-10  0:00       ` Larry Kilgallen
1996-12-11  0:00         ` Brad Balfour [this message]
1996-12-11  0:00           ` Larry Kilgallen
     [not found]       ` <01bbe6dc$6feb3620$829d6482@joy.ericsson.se>
1996-12-11  0:00         ` Norman H. Cohen
1996-12-11  0:00         ` Brad Balfour
1996-12-10  0:00 ` Jon S Anthony
1996-12-11  0:00   ` Brad Balfour
1996-12-13  0:00     ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox