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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6cb2525ffbfe23ce X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: Why both "with" and "use"? Date: 1999/02/13 Message-ID: <7a4pem$qlc$1@remarQ.com>#1/1 X-Deja-AN: 444073622 References: <36C5B28C.F32C43A4@jps.net> <7a4f85$rh1$1@remarQ.com> <7a4j3h$64e@drn.newsguy.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: newsabuse@remarQ.com X-Trace: 918939926 Y6JRGRJUHDEAEC640C usenet52.supernews.com Organization: Software Arts & Sciences Newsgroups: comp.lang.ada Date: 1999-02-13T00:00:00+00:00 List-Id: bill wrote in message <7a4j3h$64e@drn.newsguy.com>... >Also, in Java a package seems to have different purpose than with Ada. In >Java a package is a collection of classes. In OO Ada, a package usually >contains one tagged type. or is this not the normal practice? A package serves more of a central purpose in Ada 95, especially when it exports a tagged type declaration. The big difference (or, at least one difference) between Java packages and Ada packages is that the combination of an Ada package and a private type defines an Abstract Data Type. An ADT is defined as a set of legal operations and legal values, and little else. In Ada these legal operations are called "primitive operations". The primitive operations are those subprograms that are both declared *with* the type in the *same* package and that manipulate values of the type as either formal parameters or (for functions) result types. It is these primitive operations that are inherited during derivation, and only they can be dispatched to, dynamically, at run-time. An OOP object is really just an ADT plus run-time polymorphism, and a private (tagged) type defines an ADT. You can't have private types without packages, so packages are critical to OOP with Ada. Note that tagged types need not be private, but the encapsulation provided by private types is considered a central characteristic of objects in OOP. --- Pat Rogers Training & Development in: http://www.classwide.com Deadline Schedulability Analysis progers@acm.org Software Fault Tolerance (281)648-3165 Real-Time/OO Languages