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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!decwrl!stanford.edu!neon.Stanford.EDU!dugal From: dugal@neon.Stanford.EDU (Douglas S. Gray) Newsgroups: comp.lang.ada Subject: Re: Difference between inheritance and package use Keywords: Inheritance, Object Orientation Message-ID: <1991Jun24.193341.27161@neon.Stanford.EDU> Date: 24 Jun 91 19:33:41 GMT References: <1991Jun21.224640.24583@src.honeywell.com> Distribution: usa Organization: Computer Science Department, Stanford University, Ca , USA List-Id: 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)