comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Ada95 OOP Questions
Date: 1996/08/21
Date: 1996-08-21T00:00:00+00:00	[thread overview]
Message-ID: <JSA.96Aug21144455@alexandria> (raw)
In-Reply-To: 3219EFDE.7161@cmass.com


In article <3219EFDE.7161@cmass.com> Farshad Nayeri <farshad@cmass.com> writes:

> Eric Newton said:
[...]
> > In C++/Modula-3 I must list the operations on
> > the private state of Matrix within the Matrix class. 
> > I must list the operations on the private state of 
> > Vector within the Vector class.
> > There is visible association of dispatch methods and type.
[...]
> Modula-3 has separate mechanisms for encapsulation (modules & 
> interfaces) vs. inheritance and dispatching (object types). 
> An implementor can define an interface which reveals partial 
> information about one or more object types; clients can import
> only the necessary features by importing the interface that
> reveals the right kind of information about (one or more) types.
> Anyone with the right level of access to a group of classes, 
> that is, anyone who imports the right "private" interface 
> to a module, can access the private state of those classes
> as prescribed by the implementor of the interface.

This is done in Ada95 by use of child packages and/or use of
constrained generics.  In fact, it is "cake" and one of the primary
uses of these constructs.


> Steve Freeman has written a nice article for Dr. Dobb's Journal,
> comparing the encapsulation and grouping facilities of Ada95, 
> C++, Eiffel, and Modula-3. He addresses precisely the kinds of issues that
> Eric mentioned and goes through code examples to illustrate his
> point. A copy of the article is available via the Modula-3 home page.

Well, I read the article and I note that since Freeman does not
mention how this sort of stuff is quite easily done in Ada, perhaps he
does not understand the Ada model.  He does a very good job with C++.

In fact, at the first M3 (Association) example, he only mentions the
problems that C++ or Eiffel would have in so "subtyping".  Neither
problem is applicable to Ada.

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178

617.484.3383
jsa@organon.com





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

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-20  0:00 Ada95 OOP Questions Farshad Nayeri
1996-08-21  0:00 ` Jon S Anthony [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-08-20  0:00 Farshad Nayeri
1996-08-08  0:00 W. Wesley Groleau (Wes)
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
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-28  0:00 ` David C. Hoos, Sr.
1996-07-28  0:00   ` Spasmo
1996-07-29  0:00 ` Andre Spiegel
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-29  0:00   ` David Wheeler
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00     ` Spasmo
1996-07-30  0:00 ` Robert I. Eachus
1996-07-30  0:00 ` Andre Spiegel
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 ` Ken Garlington
1996-08-14  0:00 ` Jon S Anthony
1996-08-21  0:00 ` Jon S Anthony
replies disabled

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