comp.lang.ada
 help / color / mirror / Atom feed
From: Gene Ouye <geneo@rational.com>
Subject: Re: Ada95 OOP Questions
Date: 1996/08/02
Date: 1996-08-02T00:00:00+00:00	[thread overview]
Message-ID: <3202C6A9.6BC8@rational.com> (raw)
In-Reply-To: 4tor2u$ksg@Masala.CC.UH.EDU


Spasmo wrote:
> 
> Thomas Kendelbacher (Thomas.Kendelbacher@erno.de) wrote:
> : In article <4tgi88$5fi@Masala.CC.UH.EDU>, cosc19z5@Bayou.UH.EDU (Spasmo) writes:

 [much deletia...]

> : The latter is true: Even back in Ada 83, a derived type automatically
> : inherited all operations declared with the original type (in line with
> : the view of a type as "abstract data type"; the derived type would be
> : meaningless without the operations!)  This was of course preserved
> : by Ada 95; the difference is that Ada 95 now has tagged types, while
> : Ada 83 derived types were always incompatible with their parent types
> : (save by explicit conversion), and data extension was not directly
> : supported.
> 
> Gotcha.  So if I declare any type, tagged or not, then operations
> will be inherited and I can refer to them in "child packages"?
> This would mean that "inheritance" is pretty consistent regardless
> of OO extensions or not eh?
> 

Well, yes and no.  If your notion of inheritance implies polymorphism, aka 
dynamic dispatching, then no.  If you derive any type, you'll get the 
operations and the structure of the type, ie, the "record components" (or 
"data members" in other worlds ;-) but you won't get dynamic dispatching 
unless you're deriving from something that keeps some sort of type id that 
can be used at runtime, thus the "tag" of tagged records.

So, if you want polymorphism with your inheritance, you have to derive from 
tagged types.  There are other issues as well, but this is the biggest 
difference that most people notice when they come from other OOPLs.




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

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-28  0:00 Ada95 OOP Questions Spasmo
1996-07-28  0:00 ` David C. Hoos, Sr.
1996-07-28  0:00   ` Spasmo
1996-07-28  0:00 ` Andre Spiegel
1996-07-28  0:00   ` Spasmo
1996-07-29  0:00     ` Thomas Kendelbacher
1996-07-31  0:00       ` Spasmo
1996-08-01  0:00         ` Thomas Kendelbacher
1996-08-02  0:00         ` Gene Ouye [this message]
1996-08-01  0:00       ` Jon S Anthony
1996-07-30  0:00     ` David Wheeler
1996-07-31  0:00       ` Spasmo
1996-07-30  0:00     ` Ken Garlington
1996-08-04  0:00       ` Spasmo
1996-07-29  0:00 ` Andre Spiegel
1996-07-29  0:00   ` David Wheeler
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00     ` Spasmo
1996-07-29  0:00   ` Thomas Kendelbacher
1996-08-02  0:00     ` Robert Dewar
1996-08-05  0:00       ` Thomas Kendelbacher
1996-08-06  0:00         ` Robert Dewar
1996-08-06  0:00           ` Thomas Kendelbacher
1996-08-06  0:00             ` Robert A Duff
1996-08-07  0:00               ` Robert Dewar
1996-08-08  0:00                 ` Robert A Duff
1996-08-09  0:00                   ` Robert Dewar
1996-08-12  0:00             ` Robert I. Eachus
1996-08-08  0:00           ` Theodore E. Dennison
1996-08-09  0:00             ` Robert Dewar
1996-08-12  0:00             ` Joel VanLaven
1996-08-06  0:00         ` Robert I. Eachus
1996-08-10  0:00         ` Chris Morgan
1996-07-30  0:00 ` Andre Spiegel
1996-07-30  0:00 ` Robert I. Eachus
1996-07-30  0:00 ` Andre Spiegel
1996-08-01  0:00 ` Jon S Anthony
1996-08-13  0:00 ` Eric C. Newton
1996-08-14  0:00 ` Eric C. Newton
1996-08-14  0:00 ` Jon S Anthony
1996-08-14  0:00 ` Ken Garlington
1996-08-21  0:00 ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1996-08-08  0:00 W. Wesley Groleau (Wes)
1996-08-20  0:00 Farshad Nayeri
1996-08-21  0:00 ` Jon S Anthony
1996-08-20  0:00 Farshad Nayeri
replies disabled

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