comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: RE: Help me to chose between ADA 95 and C++
Date: 1999/12/16
Date: 1999-12-16T17:47:01+00:00	[thread overview]
Message-ID: <83b8il$i5k$1@nntp4.atl.mindspring.net> (raw)
In-Reply-To: NBBBJNOMKDIAJALCEFIJGELPDGAA.rleif@rleif.com

In article <NBBBJNOMKDIAJALCEFIJGELPDGAA.rleif@rleif.com>,
	"Robert C. Leif, Ph.D." <rleif@rleif.com> wrote:

>Richard
>I was remarking on a standard private type in the specification of a
generic
>or any other package. If your numeric types are declared in the private
part
>of a package, you can not set them equal to the literal value of a number,

I am sure Matt Heaney will have some good things to say about this too.
The answer is that one must export the methods appropriate to any
private type.  If that type is a numeric, then methods for all of
its uses are necessary.

In my published example, I include the operators one would expect. I
also include some functions for auxiliary services.  Some of these
would be,

        type Number is private;

        function Set (To : Integer) return Number;
        function Zero_Equivalent return Number;
        function Unit_Increment return  Number;
        function Unit_Decrement return  Number;

In the opinion of many OO practitioners, one should only export 
services in the public part of a specification.  For example, even
the popular deferred constant, under this viewpoint, would be better
designed as a function returning a constant.  That makes it more
maintainable and defers information about the constant to the
package body.  

One of the benefits of Ada is its openess to multiple models of
object-oriented design.  Not every type needs to be value extensible.
Ada child packages, and rules of elementary types, provide a model
for method extensibility that has far less overhead than might
be found in a language where the only mechanism for extensibility
is inheritance.  

Hope this helps,

Richard







  reply	other threads:[~1999-12-16  0:00 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-15  0:00 Help me to chose between ADA 95 and C++ Robert C. Leif, Ph.D.
1999-12-16  0:00 ` Richard D Riehle [this message]
1999-12-16  0:00   ` Matthew Heaney
1999-12-17  0:00     ` Richard D Riehle
1999-12-18  0:00       ` Matthew Heaney
1999-12-20  0:00         ` Richard D Riehle
  -- strict thread matches above, loose matches on Subject: below --
1999-12-22  0:00 Help me to chose between ADA 95 and C++ ( Ehud Lamm
1999-12-14  0:00 Help me to chose between ADA 95 and C++ Robert C. Leif, Ph.D.
1999-12-15  0:00 ` Richard D Riehle
1999-11-26  0:00 Robert
1999-11-26  0:00 ` Preben Randhol
1999-11-26  0:00   ` Preben Randhol
1999-11-26  0:00 ` Andreas Winckler
1999-11-26  0:00 ` Harald Schmidt
1999-11-26  0:00   ` Andreas Winckler
1999-11-26  0:00     ` Florian Weimer
1999-12-04  0:00   ` Richard D Riehle
     [not found]     ` <01bf3e32$0b9dc880$022a6282@dieppe>
1999-12-10  0:00       ` Chris Powell
1999-12-13  0:00         ` Marin D. Condic
1999-12-13  0:00         ` Richard D Riehle
1999-12-14  0:00           ` Chris Powell
1999-12-14  0:00             ` Simon Wright
1999-12-15  0:00               ` Chris Powell
1999-12-15  0:00                 ` Robert A Duff
1999-12-14  0:00             ` Richard D Riehle
1999-12-14  0:00               ` Matthew Heaney
1999-12-14  0:00             ` Ray Blaak
1999-12-14  0:00             ` Larry Kilgallen
1999-12-15  0:00               ` Robert A Duff
2000-01-12  0:00                 ` Richard Pinkall-Pollei
1999-12-15  0:00             ` Ted Dennison
1999-12-20  0:00               ` Stefan Skoglund
1999-12-16  0:00             ` Pascal Obry
1999-12-16  0:00               ` Rakesh Malhotra
1999-12-21  0:00                 ` Geoff Bull
1999-12-16  0:00               ` Lutz Donnerhacke
1999-12-16  0:00               ` Aidan Skinner
1999-12-21  0:00             ` Robert Dewar
1999-12-21  0:00               ` Ted Dennison
1999-12-21  0:00                 ` Robert Dewar
1999-12-21  0:00               ` Chris Powell
1999-12-13  0:00         ` Brian Rogoff
1999-12-14  0:00           ` Chris Powell
1999-12-14  0:00             ` Preben Randhol
1999-12-14  0:00               ` Stephen Leake
1999-12-14  0:00                 ` Tucker Taft
1999-12-15  0:00                   ` Stephen Leake
1999-12-15  0:00                 ` Preben Randhol
1999-12-14  0:00             ` Brian Rogoff
1999-12-15  0:00           ` Richard Pinkall-Pollei
1999-12-15  0:00             ` Richard Pinkall-Pollei
1999-12-21  0:00             ` Geoff Bull
1999-12-21  0:00               ` Tucker Taft
1999-12-22  0:00                 ` Ted Dennison
1999-12-13  0:00         ` DuckE
1999-12-14  0:00           ` Matthew Heaney
1999-12-14  0:00         ` Matthew Heaney
1999-12-14  0:00           ` Chris Powell
1999-12-14  0:00             ` Tucker Taft
1999-12-14  0:00               ` Matthew Heaney
1999-12-23  0:00               ` Chris Powell
1999-12-27  0:00                 ` Robert A Duff
1999-12-14  0:00             ` Matthew Heaney
1999-12-15  0:00               ` Hyman Rosen
1999-12-14  0:00             ` Stephen Leake
1999-12-23  0:00               ` Chris Powell
1999-11-27  0:00 ` Lionel Draghi
replies disabled

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