comp.lang.ada
 help / color / mirror / Atom feed
From: dugal@neon.Stanford.EDU (Douglas S. Gray)
Subject: Re: Difference between inheritance and package use
Date: 24 Jun 91 19:33:41 GMT	[thread overview]
Message-ID: <1991Jun24.193341.27161@neon.Stanford.EDU> (raw)
In-Reply-To: 1991Jun21.224640.24583@src.honeywell.com

In article <1991Jun21.224640.24583@src.honeywell.com> msmiller@aconcagua.src.honeywell.com (Mike Miller) writes:
>
>How does (or more properly, how will) the upcoming addition of
>inheritance and object oriented stuff (for lack of a better word at
>the moment) differ from the definition of something in a package and
>its use later?

   Although there have been a number of good answers covering inheritance 
(notably, Jim Showalter's), I haven't seen one which addressed one very
basic difference between a C++ object and an Ada package.  The object is a
first-class programming construct, where the package is not.  The
encapsulation provided by a package is not as powerful as that in an
object.  You can create an array of objects or pass an object to a
subprogram.  Packages are static where objects are dynamic.

   From what I've read in the Ada 9X reports, it appears that there is no
plan to enhance the power of packages.  Instead, inheritance will be added
to types*.  Does anyone have more complete information than that?

Doug Gray
dgray@sadis02.sa.aflc.af.mil
dugal@cs.stanford.edu

* From Draft Mapping Document (Feb 1991) section 3.4(Derived Types) and
section 7(Ada 9X Packages).  Also, see Draft Mapping Rationale Document
(Feb 1991) section 3(Data Abstraction and Object-Oriented Programming)

  parent reply	other threads:[~1991-06-24 19:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-06-21 22:46 Difference between inheritance and package use Mike Miller
1991-06-22  1:31 ` Jim Showalter
1991-06-23 13:59   ` Alan Knight
1991-06-23 18:51     ` Jim Showalter
1991-06-23 22:02       ` Milt Ratcliff
1991-06-23 20:16     ` Philip Machanick
1991-06-24 19:33 ` Douglas S. Gray [this message]
1991-06-24 20:39   ` Rob Spray
1991-06-25 16:04     ` Douglas S. Gray
1991-06-25 19:52   ` Jim Showalter
  -- strict thread matches above, loose matches on Subject: below --
1991-06-22  3:53 Chuck Shotton
1991-06-23  3:06 ` Jim Showalter
1991-06-23  8:38   ` Orville R. Weyrich
1991-06-24  3:32   ` Marco S Hyman
replies disabled

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