From: anders@cui.unige.ch (BJORNERSTEDT Anders)
Subject: Re: Re^2: Integrating concurrent & O-O programming
Date: 23 Nov 89 16:18:49 GMT [thread overview]
Message-ID: <481@cui.unige.ch> (raw)
In-Reply-To: 477@cui.unige.ch
In article <477@cui.unige.ch> oscar@cui.unige.ch (NIERSTRASZ Oscar) writes:
>In object-oriented languages, there are (at least) *two* clients to
>object classes: the clients of the object instances, and subclasses
>that wish to inherit the code. If you view inheritance as purely a
Another interface is the interface to other instances of the same class.
Try implementing the class integer with a method add in Smalltalk
without exposing your internal representation.
You can actually distinguish four different interfaces:
1- The interface to self of the same class. No encapsulation wanted here :-)
2- The interface to self of some other (super)class.
3- The interface to some other instance of the same class.
4- The interface to some other instance of some other class.
In the programming language PAL of the Avance prototype (see oopsla88)
we made no distinction between 2 and 3 and had three kinds of operations.
Public operations could be used by 1-4.
Private operations could be used by 1-3.
Hidden operations and instance variables could be used by 1.
The concept of a "friend functions" in C++ is related to this and further
subdivides 4. [I am not a c++ expert though so I may be wrong].
>2. the interface of the superclass to inheriting subclasses must be
> specified as completely as the interface of an object to
> its clients.
>We would prefer solution 2, but unfortunately we don't know how to do this
>very well, although we try sometimes to make do with natural language.
Kind 2 operations give you exactly this.
Kind 3 operations allow you to implement an "algebra" without exposing the
internals of objects.
If you have a distributed system then the distinction of kind 2 and 3
operations becomes important for another reason. Directly accessing
non-local state may not be practical. Some people argue that inheritance
is not useful or even "inconsistent" with distribution. Kind 2 operations
at least makes inheritance "consistent" with distribution. Whether it
is useful can be debated. Still if you drop inheritance from the object
model of a distributed system, operations of kind 3 become important.
For further arguments on this last issue you can read the article on
Emerald in IEEE transactions on software engineering January 1987.
---------------------------------------------------------------------
Anders Bjornerstedt E-mail: anders@cuisun.unige.ch
Centre Universitaire d'Informatique
12 rue du Lac, CH-1207 Geneva
---------------------------------------------------------------------
Tel: 41 (22) 787.65.80-87 Fax: 41 (22) 735.39.05
Home: 41 (22) 735.00.03 Telex: 423 801 UNI CH
---------------------------------------------------------------------
next prev parent reply other threads:[~1989-11-23 16:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1989-11-15 19:30 Integrating concurrent & O-O programming Bill Wolfe
1989-11-21 4:09 ` Tim Atkins
1989-11-22 22:08 ` 3929
1989-11-22 22:37 ` Dan Weinreb
1989-11-23 2:52 ` Ziaul Masum Hasan
1989-11-23 9:46 ` Re^2: " NIERSTRASZ Oscar
1989-11-23 16:18 ` BJORNERSTEDT Anders [this message]
1989-11-26 14:04 ` Markku Sakkinen
1989-11-23 14:56 ` BJORNERSTEDT Anders
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox