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,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ad42f911d53327e,start X-Google-Attributes: gid103376,public From: "Michael Garrett" Subject: Object Oreinted Style Date: 2000/03/28 Message-ID: <8bq4hh$psj$1@ssauraac-i-1.production.compuserve.com>#1/1 X-Deja-AN: 603361575 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: newsmaster@compuserve.com X-Trace: ssauraac-i-1.production.compuserve.com 954242417 26515 216.192.165.6 (28 Mar 2000 11:20:17 GMT) Organization: CompuServe Interactive Services X-MSMail-Priority: Normal NNTP-Posting-Date: 28 Mar 2000 11:20:17 GMT Newsgroups: comp.lang.ada Date: 2000-03-28T11:20:17+00:00 List-Id: I have seen two philosophies concerning "class" construction in Ada95. In the RM, a class is defined as: Class. A class is a set of types that is closed under derivation, which means that if a given type is in the class, then all types derived from that type are also in the class. The set of types of a class share common properties, such as their primitive operations. and Package as: Package. Packages are program units that allow the specification of groups of logically related entities. Typically, a package contains the declaration of a type (often a private type or private extension) along with the declarations of primitive subprograms of the type, which can be called from outside the package, while their inner workings remain hidden from outside users. In "Object Oriented Software in Ada 95" Michael A. Smith uses the package as a "class" construct, putting one tagged type and it's associated operations into a single package, and derived types in there own top level ( NON child ) packages. He warns against breaking encapsulation rules by deriving types in child packages. In the booch components, derived types are declared included in child packages. In a large embedded system, which method would make for more maintainable code, one type per package, or a "class" multiple derived types? -- Michael C. Garrett Vice President Research and Development Medical Research Laboratories www.mrlinc.com michaelgarrett@csi.com