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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a8985ede8fe3d111 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-19 08:58:39 PST Path: bga.com!news.sprintlink.net!sundog.tiac.net!wizard.pn.com!satisfied.elf.com!news.mathworks.com!news.duke.edu!eff!blanket.mitre.org!linus.mitre.org!linus!mbunix!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: Child packages Date: 19 Oct 94 11:03:08 Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <1994Oct4.090807@di.epfl.ch> <37kanl$jfd@u.cc.utah.edu> <1994Oct18.103131@di.epfl.ch> <3816h5$n3g@schonberg.cs.nyu.edu> NNTP-Posting-Host: spectre.mitre.org In-reply-to: dewar@cs.nyu.edu's message of 18 Oct 1994 15:09:25 -0400 Date: 1994-10-19T11:03:08+00:00 List-Id: In article <3816h5$n3g@schonberg.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) writes: > One thing that should be emphasized about child packages (since some of > the posts of this thread have not been clear on this point) is that > child packages in no way change their parents. If you have a parent A, > and a child A.B, then if A.B does horrible things to the abstractions > in A, it still does not affect anyone who with's only package A. It is > only if package A.B is with'ed that the effects of the child are > noticable. Very misleading. If a PROGRAM doesn't include any withs of a child, the child is not part of that program and can't harm it. But a child unit can--even during elaboration--change hidden state in the parent's private part. So a child added by one portion of a large project can harm other users of the parent package and it can be very hard to track down. This risk on large projects should not be understated. (And, yes, project management tools can control or eliminate the problem, but these tools do not yet exist for Ada 9X. At least tools which address this particular issue.) Note that on many projects the interfaces between subsystems are specified as packages with only type and subprogram declarations in the public part. If 9X were only used for new projects, the simple solution would be to outlaw state in the private part as well. As it is, the solution is to strongly restrict children of such packages. As I said, child units like fire are a net win. But we still need to learn how to handle them safely. They can easily be abused. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...