comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Private Children
Date: 1999/06/23
Date: 1999-06-23T18:19:18-05:00	[thread overview]
Message-ID: <7krq1m$m2@dfw-ixnews5.ix.netcom.com> (raw)
In-Reply-To: 7kra6p$t5h$1@remarQ.com

In response to my example of opaque types in Ada,

In article <7kra6p$t5h$1@remarQ.com>,
	"Vladimir Olensky" <vladimir_olensky@yahoo.com> wrote:

>There is very interesting article about using M3 opaque types. It was
>published in Dr.Dobb's journal
>in October 1995 and now it is available online at
>http://www.research.digital.com/SRC/modula-3/html/partial-rev/index.html

The article you cited by Steve Freeman is certainly a thoughtful and
fair treatment of some of the issues related to interface inheritance
versus implementation inheritance.  It is especially potent in highlighting
some of the drawbacks of C++, but I doubt any C++ users from the Dr. Dobbs
readership paid serious attention to that.

In Mr. Freeman's Ada example, he assumes that the private part of
the package must contain a complete view of the data. That is exactly 
the opposite of the example I posted earlier. In Ada, we can declare
an incomplete type, an access to that type, enclose within a tagged 
record a value of the access type, and defer the full description of the
data until later. This is the essence of an opaque type. Opaque types 
are convenient in both Ada and Modula-3 because of their clear separation 
of interface module (package specification) from implementation module
(package body).  This is more difficult in Java, C++, and even Eiffel, as 
demonstrated in Mr. Freeman's article.

Although the Ada opaque type must be implemented using an access type,
it does overcome one of the complaints Mr. Freeman has about Ada's
structure:  changes can be made to the full data definition, the 
implementation, in the package body without changing the interface. 
I agree that the use of an Ada access type to design an opaque type is 
not quite as elegant as the semantics of the Modula-3 REVEAL keyword. 
However, it is effective, clean, efficient and expressive enough
to permit a an opaque type design that distinguishes implementation 
inheritance from specification inheritance.

Richard Riehle
richard@adaworks.com
http://www.adaworks.com

 




  reply	other threads:[~1999-06-23  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-20  0:00 Private Children Matthew Heaney
1999-06-21  0:00 ` Ted Dennison
1999-06-21  0:00   ` Tucker Taft
1999-06-21  0:00     ` Matthew Heaney
1999-06-21  0:00     ` Matthew Heaney
1999-06-21  0:00       ` Tucker Taft
1999-06-22  0:00         ` Richard D Riehle
1999-06-22  0:00           ` Dale Stanbrough
1999-06-22  0:00             ` Richard D Riehle
1999-06-22  0:00             ` Matthew Heaney
1999-06-23  0:00               ` Dale Stanbrough
1999-06-23  0:00                 ` Matthew Heaney
1999-06-23  0:00                   ` Dale Stanbrough
1999-06-23  0:00                     ` Richard D Riehle
1999-06-23  0:00                       ` Vladimir Olensky
1999-06-23  0:00                         ` Richard D Riehle [this message]
1999-06-24  0:00                           ` Hyman Rosen
1999-06-24  0:00                             ` Richard D Riehle
1999-06-23  0:00                       ` John Duncan
1999-06-24  0:00                       ` Dale Stanbrough
1999-06-25  0:00   ` Robert Dewar
1999-06-21  0:00 ` Dale Stanbrough
replies disabled

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