comp.lang.ada
 help / color / mirror / Atom feed
From: je@bton.ac.uk (John English)
Subject: Re: on OO differnces between Ada95 and C++
Date: 1996/02/21
Date: 1996-02-21T00:00:00+00:00	[thread overview]
Message-ID: <Dn4J2F.uI@bton.ac.uk> (raw)
In-Reply-To: 4gbq7q$g08@qualcomm.com

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 <je@brighton.ac.uk>, Dept. of Computing, University of Brighton
  "Disks are divided into sex and tractors..."
----------------------------------------------------------------------------




  parent reply	other threads:[~1996-02-21  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-20  0:00 on OO differnces between Ada95 and C++ Nasser Abbasi
1996-02-20  0:00 ` Robert I. Eachus
1996-02-20  0:00 ` Jerome Desquilbet
1996-02-21  0:00   ` Robert Dewar
1996-02-22  0:00     ` Jerome Desquilbet
1996-02-24  0:00       ` Robert Dewar
1996-02-22  0:00   ` Pete Becker
1996-02-23  0:00     ` Jerome Desquilbet
1996-02-26  0:00     ` Darren C Davenport
1996-02-26  0:00       ` Pete Becker
1996-02-27  0:00         ` Nigel Perry
1996-02-20  0:00 ` Norman H. Cohen
1996-02-21  0:00   ` Mark A Biggar
1996-02-22  0:00     ` Norman H. Cohen
1996-02-27  0:00   ` Adam Morris
1996-02-21  0:00 ` Jon S Anthony
1996-02-21  0:00 ` John English [this message]
1996-02-22  0:00   ` Gene Ouye
1996-02-26  0:00     ` John English
1996-02-22  0:00   ` Nasser Abbasi
1996-02-26  0:00     ` John English
1996-02-27  0:00       ` Dale Stanbrough
1996-02-21  0:00 ` Darren C Davenport
  -- strict thread matches above, loose matches on Subject: below --
1996-02-21  0:00 Christian Jaensch, FRG
1996-02-26  0:00 Simon Johnston
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox