Path: utzoo!attcan!uunet!mcsun!i2unix!inria!seti!wally!jml From: jml@wally.altair.fr (Jean Marie Larcheveque) Newsgroups: comp.object Subject: Re: prototypes and degenerate cases Message-ID: <1608@seti.inria.fr> Date: 14 Sep 90 09:36:03 GMT References: <1990Sep13.235832.23454@Neon.Stanford.EDU> Sender: news@seti.inria.fr Organization: Gip Altair/INRIA, France Lines: 27 In article <1990Sep13.235832.23454@Neon.Stanford.EDU> craig@Neon.Stanford.EDU (Craig D. Chambers) writes: > >I think there's some confusion about dynamic inheritance in Self. In >the circle-mutating-into-ellipse example, there would be a *child* >object of either a circle object or an ellipse object, and other >objects would point to this child. This child would act just like >either a circle or an ellipse, because of normal object inheritance >(the state and behavior of the parent is inherited, and accessible >transparently to clients who can't tell there's an extra child object >serving as mediator). The decisive decision here is not the use of dynamic inheritance, but the creation of an extra link (an empty child, inheriting behavior *and* state) to avoid having to update external links when the representation changes. The same scheme could be implemented for example in C++, with something like class ellipse { concrete_ellipse state_holder; // ... } with concrete_ellipse a subclass of ellipse and a superclass of circle. -- Jean-Marie Larcheveque or