comp.lang.ada
 help / color / mirror / Atom feed
From: Farshad Nayeri <farshad@cmass.com>
Cc: farshad@cmass.com, kalsow@cmass.com, steve@cmass.com
Subject: Re: Ada95 OOP Questions
Date: 1996/08/20
Date: 1996-08-20T00:00:00+00:00	[thread overview]
Message-ID: <3219EFDE.7161@cmass.com> (raw)


Eric Newton said:

> The point of the (deleted) example was to show that 
> a package is just a namespace, and that multiple classes 
> can live in that namespace, and that the features of 
> the class do not need to be visibly associated
> with the dispatch object.  Matrixes encapsulates 
> Matrix *and* Vector types. I can list the Matrix and 
> Vector operations willy-nilly within this namespace.  

> 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.

While this may be true of C++'s, it is an inaccurate
statement about Modula-3's organization of namespaces and 
visibility of class features. In fact, much care went 
into designing namespaces and avoiding problems in the 
C++ "public/private/protected/friend" model as you describe. 

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.

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.

	http://www.research.digital.com/SRC/modula-3/html/

Regards, -- Farshad

Disclaimer: I am biased!
--
Farshad Nayeri
Critical Mass, Inc.
http://www.cmass.com/




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

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-20  0:00 Farshad Nayeri [this message]
1996-08-21  0:00 ` Ada95 OOP Questions Jon S Anthony
  -- 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 ` 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
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 ` 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