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.9 required=5.0 tests=BAYES_00 autolearn=ham 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 04:05:42 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!drn From: mike@nospam Newsgroups: comp.lang.ada Subject: Re: on package naming, should the word "_pkg" be part of it? Date: 5 Oct 2001 03:35:38 -0700 Organization: Newsguy News Service [http://newsguy.com] Message-ID: <9pk2dq01gvu@drn.newsguy.com> References: <9pif1o01btl@drn.newsguy.com> <9pii95$jus$1@nh.pace.co.uk> <3bbd7a77.5463085@news.demon.co.uk> NNTP-Posting-Host: p-967.newsdawg.com X-Newsreader: Direct Read News 2.90 Xref: archiver1.google.com comp.lang.ada:13770 Date: 2001-10-05T03:35:38-07:00 List-Id: In article <3bbd7a77.5463085@news.demon.co.uk>, john.mccabe@emrad.com.nospam says... > >In my last Ada position we found a large number of cases where this >was just not sensible. Finally our agreement was to use the package >name as the plural of the type of information it contained. So we >would have: > >package Cars is > > type Car is tagged > record > .... > end record; > > procedure DoSomething (This : in Car); > .... >end Cars; > These sorts of things are never a problem in Java. Do not see why Ada programmers always have a problem with it. For example, in Java, the package java.awt.event contains these classes: ActionEvent AdjusmentEvent ComponentAdapter ContainerAdapter etc... The reason to having these problems with Ada is this: In Java, each class goes into one separate file (in general, public classes, etc..), and in Java, a package is not a physical thing, it is the name of the directory where the classes sit. i.e. there is no physical file that represents a package. In Ada, many do not like a use single package file to contain 20 tagged records declarations in the same file with all the primitive operations on each one of those tagged record, and they want to have a one tagged record per one package. This causes the above naming problem. 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; Using the above, will solve all these naming problem. But what it will do, is make the java package file HUGE. It is basically like putting all the code in those separate java class files into one big file. This means if one modifies one line of code the package file, many other files will have to be recompiled. No big deal, computers are fast these days. After all, a package should contain related types in it, and if the package happened to have 20-30 related types, so they all go into the same one physical file (i.e. same package).