WindowFrame design

Jesse Welton jwelton at pacific.mps.ohio-state.edu
Fri Jul 13 12:42:15 UTC 2001


Jim Benson wrote:
> 
> [...]  I've been
> trying to think of Morphic as the reification of objects on the screen. When
> I look at a SystemWindow on the screen, I can see if it has a close box. If
> it has one, I can open an explorer and examine the structures. From that
> perspective, there is no advantage in having the close box cached in an
> ivar, and for me the less duplicate structures the better.

On the other hand, it's better for the code to make as few assumptions
about submorph structure as possible.  In this way, indeed there is a
benefit of having the close box cached in an ivar: it makes the
structure of SystemWindows more flexible.  It may not be terribly
advantageous on a day-to-day basis (unless you like tearing your
windows apart), but it's quite nice if you ever want to make changes
to the submorph structure of SystemWindows.

For a concrete example, you mentioned that the close box is a submorph
of the SystemWindow; but in fact it is now a submorph of the
SystemWindow's titleArea.  This change would have been considerably
more of a pain to implement if SystemWindow had used
  self submorphNamed: 'closeBox'
instead of simply refering to the ivar.

Looked at another way, while it is true that duplicating structures is
often bad, the two structures in question here are not representing
precisely the same relationships.  The ivar structure represents a
logical structure of parts having specific known functions, while the
submorph structure is more of a graphical assembly structure.  They're
not, strictly speaking, duplicating information.

-Jesse





More information about the Squeak-dev mailing list