comp.lang.ada
 help / color / mirror / Atom feed
From: croizier@rennes.enst-bretagne.fr (Valery Croizier)
Subject: Re: Real OO (was Choice of OO primitives in Ada95)
Date: 1996/02/24
Date: 1996-02-24T00:00:00+00:00	[thread overview]
Message-ID: <yrgka1c1oq7.fsf@lupin.rennes.enst-bretagne.fr> (raw)
In-Reply-To: Dn5qGH.9xH@assip.csasyd.oz

In article <Dn9BzB.IMA@world.std.com> bobduff@world.std.com (Robert A Duff) writes:

> You seemed to object strongly to the idea that one can put two types in
> the same package, on the grounds that it decreases encapsulation.  On
> the contrary, it *increases* encapsulation.  When two types are closely
> related to each other, by their nature, *forcing* them to be in separate
> modules means that *more* operations need to be exported from each
> module.
> [...]
> An example is a List type, plus a List_Cursor type.  The List_Cursor
> points at a certain place in the list, and has operations for moving
> forward and/or backward and so forth.  These operations cannot be
> written without visibility on implementation details of *both* types.
> So if class=module, you have to *export* a lot of those implemenation
> details from one of them, so the other one can do what it needs to do.
> Putting them both in the same module, however, actually gives you
> *better* encapsulation, because fewer (and higher-level) operations get
> exported.

Yes, you have to export internals to the other class, but
encapsulation is not weaker, because you can do a selective export, so
that no one (except List_Cursor) can see List's internals.
Putting two types in the same module weakens encapsulation, because it
exports : 
	o *all* internals 
	o to *each other* types 
in that module, while Eiffel allowes the programmer to export only
useful data to classes that need them.
For example, type Person has a field Disease.  Only a Doctor can see
this field, because only doctors are able to identify diseases.
You can't put Person and Doctor in the same package, because :
	o Doctor would see *all* private data of Person
and, that is worse,
	o Person would see all private data of *Doctor*.
Ada's solution works fine with the List_Iterator issue, because
List and List_Cursor aren't complex structures.

> [...]
> So I've heard.  How does this new elegant model deal with the issue I
> mentioned above, about putting list-cursor information inside the list
> itself?  If you have multiple tasks, you definitely want to have two
> tasks iterating through the same shared list (or whatever data
> structure).  Has the standard class library been changed to solve this
> problem?

The issue have little to do with tasking. Even in a sequential
program, a List can have several clients.
As far as Eiffel Libraries are concerned, I don't know them well, but
I've just ckecked ISE's and Tower's Web site, and there is no list in
the Library Kernel.  Of course, vendors provide their own librairies,
and the most prominent ones have traversable lists (at least Sig and
Tower have).

--
Valery CROIZIER




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

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DMqHqF.9F1.0.-s@inmet.camb.inmet.com>
     [not found] ` <DMu9yw.5ts@assip.csasyd.oz>
     [not found]   ` <4g2f8v$15lc@watnews1.watson.ibm.com>
1996-02-19  0:00     ` Choice of OO primitives in Ada95 Don Harrison
1996-02-19  0:00       ` Robert A Duff
1996-02-20  0:00         ` Don Harrison
1996-02-20  0:00           ` Jon S Anthony
1996-02-22  0:00             ` Real OO (was Choice of OO primitives in Ada95) Don Harrison
1996-02-22  0:00               ` Jon S Anthony
1996-02-22  0:00               ` Robert Dewar
1996-02-23  0:00                 ` Gene Ouye
1996-02-26  0:00                   ` James O'Connor
1996-02-26  0:00                     ` Gene Ouye
1996-02-24  0:00               ` Robert A Duff
1996-02-26  0:00                 ` Matthew B. Kennel
1996-02-26  0:00                 ` Don Harrison
1996-02-24  0:00               ` Valery Croizier [this message]
1996-02-26  0:00               ` So called Real OO (was blah blah blah...) Jon S Anthony
1996-02-20  0:00           ` Choice of OO primitives in Ada95 Ray Toal
1996-02-21  0:00             ` Don Harrison
1996-02-23  0:00               ` Robert A Duff
1996-02-22  0:00             ` Bernd Holzmueller
1996-02-23  0:00               ` Robert A Duff
1996-02-23  0:00           ` Robert A Duff
1996-02-19  0:00       ` Norman H. Cohen
1996-02-21  0:00       ` Robert I. Eachus
1996-02-21  0:00     ` John DiCamillo
1996-02-22  0:00       ` Don Harrison
1996-02-24  0:00         ` Robert A Duff
1996-02-22  0:00 Real OO (was Choice of OO primitives in Ada95) Jean-Pierre Rosen
1996-02-22  0:00 ` Valery Croizier
1996-02-24  0:00   ` Robert A Duff
1996-02-22  0:00 ` Matt Kennel
1996-02-23  0:00   ` Robert A Duff
1996-02-22  0:00 ` Spencer Allain
1996-02-23  0:00 ` Jon S Anthony
     [not found] <Do7uyC.4K2@world.std.com>
1996-03-15  0:00 ` Don Harrison
     [not found] <Do7unJ.1sq@world.std.com>
1996-03-15  0:00 ` Don Harrison
replies disabled

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