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: 109fba,9ac62ca34a465706 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,9ac62ca34a465706 X-Google-Attributes: gid103376,public From: je@bton.ac.uk (John English) Subject: Re: on OO differnces between Ada95 and C++ Date: 1996/02/21 Message-ID: #1/1 X-Deja-AN: 140386974 references: <4gbq7q$g08@qualcomm.com> organization: University of Brighton, UK followup-to: comp.lang.ada,comp.lang.c++ newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-02-21T00:00:00+00:00 List-Id: Nasser Abbasi (nabbasi@qualcomm.com) wrote: : Lets also assume that we need to define a Money Type, defined in : the base class Account. : In Ada95 this type is defined in the package Account.ads that also : includes the definition of the tagged record type Account (along with : operations that act on Account type). : Now, In Ada95, a client that wishes to use Saving_Account type (and : any operations on it) will "with" the Saving_Account Package. If the spec of Saving_Account has "with Account" at the beginning, "with Saving_Account" will imply "with Account". Or use child packages: make Saving_Account a child of Account (e.g. Account.Saving) so that it is effectively an extension of Account. : In C++, the client to the saving_account class can also use the : Money_Type type (even though that is defined in : the base class Account) without having to include base class : "account.h", this is because Money_Type has become a public part of the : Saving_Account class when Saving_Account inherited Saving class. You can always put "subtype Money_Type is Account.Money_Type" in Saving_Account to make it directly usable from Saving_Account... -- ---------------------------------------------------------------------------- John English , Dept. of Computing, University of Brighton "Disks are divided into sex and tractors..." ----------------------------------------------------------------------------