are RectangleMorph and Rectangle polymorphic

Andreas Raab Andreas.Raab at gmx.de
Sun Nov 18 21:23:31 UTC 2001


Stephane,

> > To me, as I said, the current state of affairs is a
> > manifestation of the difference between system programming
> > and end-user programming.  And the question is:  Should
> > there be any difference?  Alan will say no.  I say I
> > don't know.  But Alan has often turned out to be right ;-).
>
> I understand the point. I'm not sure that there is a
> solution. In addition adding rectangle protocol to morph
> would really make the interface even bigger.

But that's "only" a UI problem not a conceptual one. It seems utterly
obvious that we should expect a RectangleMorph (or perhaps any morph) to
understand the entire Rectangle protocol. However, the way we _see_ the
protocol today is much more problematic. It is because one level of
structuring is removed - rather than showing that "this group of messages is
the polymorphic representation of Rectangle's interface" we only have a
single unstructured view of the object. At the point where we would have the
distinction we'd need here things would look a lot simpler (to both, the
end-user and the professional).

> I was just programming a trivial model for animal behavior
> simulation using rectangle and after I finished. I realized
> that it would be cool to display it. So I thought easy I just
> have to replace the rectangle that represents the animal world
> into rectangleMorph and hop. But I realized I could not.

Which is unfortunate and in fact shows one of the current weaknesses of
Squeak pretty directly. It should be absolutely possible and straightforward
to do exactly what you describe by simply putting a "costume" on that
rectangle (which, in itself, may not even be necessarily rectangular).

> I do not know why I tried, I think that this was the
> lazzyness to introduce a model-representation layer
> but this is induced by the feeling that morphs
> are concrete representation of objects.

I think you tried this for exactly the right reasons - namely taking
something in its symbolic form and try to put a concrete representation on
top of it.

> We are brainstroming with Nathanael on mixins and I was wondering if
> RectangleMorph and Rectangle are not a nice example where the simple
> approach of mixin failed because you would like to specify
> mapping between functionalities in one class over the other one.
> Anyway I'm trying to analyse my thoughts.

Keep going! This direction is extremely valuable.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list