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.6 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7eaf9f2597de2259 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-05 08:57:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <9pif1o01btl@drn.newsguy.com> <9pii95$jus$1@nh.pace.co.uk> <3bbd7a77.5463085@news.demon.co.uk> <9pk2dq01gvu@drn.newsguy.com> <9pkicf02ncr@drn.newsguy.com> Subject: Re: on package naming, should the word Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Fri, 05 Oct 2001 11:56:37 EDT Organization: http://www.newsranger.com Date: Fri, 05 Oct 2001 15:56:37 GMT Xref: archiver1.google.com comp.lang.ada:13799 Date: 2001-10-05T15:56:37+00:00 List-Id: In article <9pkicf02ncr@drn.newsguy.com>, mike@nospam says... > >In article , Ted says... >> >>>So, I do not see why one can't do this in Ada >>> >>>package Ada.awt.event is >>> type ActionEvent is tagged record .... end record; >>> -- primitive operations on ActionEvent here >>> >>> type AdjustmentEvent is tagged record .... end record; >>> -- primitive operations on AdjutsmentEvent here >>> etc... >>>end Ada.awt.event; > >> >>You don't want to do this, because it gives all these classes complete >>visibility into each other's implementation. > >I was mapping the Java classes/packge to Ada. In Java, all classes in >the same package have the default access such that they can see each others. The proper progression for classes A and B in Ada is: 1) If A and B can't see each other's "protected" areas, then they should be in different packages. 2) If A *can* see B's "protected" area, but not visa-versa, then A should be in a child package of B. 3) If they are so horribly intertwined that they need to see each other's "protected" areas, then they must go in the same package (assuming you can't find some way to untangle them a bit). However, this is quite a bit stronger than 2, as A and B can also share invisible implementation data that isn't available to children (because its declared in the body of the package). As a reader client of them, I have to assume that this kind of interaction can be going on, and thus there really is no clearly-defined separation between A and B. They are like "Siameese twins", possibly sharing vital organs. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.