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,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 07:39:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!feed.textport.net!out.nntp.be!propagator-SanJose!news-in-sanjose!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> 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 10:39:11 EDT Organization: http://www.newsranger.com Date: Fri, 05 Oct 2001 14:39:11 GMT Xref: archiver1.google.com comp.lang.ada:13791 Date: 2001-10-05T14:39:11+00:00 List-Id: In article <9pk2dq01gvu@drn.newsguy.com>, mike@nospam says... > >These sorts of things are never a problem in Java. Do not see why Ada >programmers always have a problem with it. The issue in Ada is that the OO concept of a "class" is not implemented by a single syntax element, like it is in Java or most other OO languages. Instead it is implemented by a package and a tagged type *together*. That means that in effect *both* the tagged type and the package are the class, and thus logicly (in most folks heads) deserve the same name. The only good way out of this quandry is to come up with an arbitrary convention. Since its arbitrary, no one convention is clearly superior to the other, so there are several equally valid styles floating around. >For example, in Java, the package java.awt.event contains these classes: > >ActionEvent >AdjusmentEvent >etc... I know there are other issues with the package in Java. But if this were Ada, I'd say you'd need to take "event" off of the first two. Java.AWT.Event.ActionEvent contains redundant naming information. >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 > > type ActionEvent is tagged record .... end record; > -- primitive operations on ActionEvent here > > type ComponentAdapter is tagged record .... end record; > -- primitive operations on ComponentAdapter 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. Also, any use of one within the other may cause premature freezing problems in the spec. --- 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.