'Classness' of composites (Re: Single page programs) (long)
Marcel Weiher
marcel at system.de
Wed Dec 16 15:26:44 UTC 1998
Alan,
this maybe another red herring (the frequently discussed
'interfaces/protocols' one), but it seems to me that what kind of
object an instance *is* is not really an appropriate question in most
situations. The question should be what kind of object it can *act
as*. This reminds me of the short definition of gerunds in the
english language: a verb that acts like a noun.
The only way I see of accomplishing this would be with some kind of
formal protocol mechanism, which could also be used to succinctly +
declaratively (!) state some delegation situations: "Class A
implements protocol B by delegating it to instance variable C
(self-sends are mapped to composite/delegate)". So actually, this
may be two red herrings in a single message :-)
Marcel
> Actually one of the central mechanisms in most object oriented systems
> does
> supply a facility for dealing with "dynamic object compositions"
and does
> make "Object composites" into real objects. It's just that "no one"
> (meaning with very few exceptions) has tried to flesh out the facility.
> What am I referring to? Why, *instances* themselves. What they are is
> precisely an object that is a composition of objects. What obtains
right
> now is the possibility of carrying out some of your yearnings, but the
> barriers (especially in Squeak) are currently more of an awkwardness of
> approach and a lack of some important ways to delegate messages to the
> composite, than more substantial roadblocks. Right now, there is a
> tendency
> to revert to "data-structure" programming for compositions (e.g. toss
> the
> composite into a collection) and this holds back progress.
> This is a nice job for metaprogramming, and I'm hoping we can
exhibit
> some real improvements in this area in calendar '99. I would like to
> solicit ideas about this that can help the design. One of the most
> interesting "algebraic" areas parallels that of the problems of
multiple
> inheritance: what *kind* of object is an instance that is being
used as a
> composer? The instance (at least in Squeak) belongs to a class by
> definition, but one might want to derive some additional
"classness" from
> the objects in the instance, etc. (Please folks, rise above the
tendency to
> start debating "prototypes vs classes" again -- this is a red
herring in
> almost all areas and has almost nothing to do with the current
discussion
> ...).
More information about the Squeak-dev
mailing list
|