newbie question about morphs

Bob Arning arning at charm.net
Wed May 30 17:41:35 UTC 2001


Hi Rosemary,

On Wed, 30 May 2001 13:16:11 -0400 (EDT) Rosemary Michelle Simpson <rms at cs.brown.edu> wrote:
>In addition, a given instance can contain multiple pointers to another 
>specific instance at different levels.  For example, "Catherine 
>Marshall" (a Person instance) can appear multiple times at several 
>levels as part of the "Spatial Hypertext" Concept instance.
>
>If I understand correctly what seems to be true about composite 
>morphs - that a given morph can be embedded in one and only one 
>composite morph

True.

 - then I cannot use Morphic to model my world 
>and must instead work with MVC.  Is this correct?

False. 

The distinction you want to draw is between something that can exist only once, like "Catherine Marshall" (a Person instance) and things related to Catherine that look like Catherine and appear many places at once. It's the old model-view distinction and, while MVC has "model" and "view" in its name, Morphic is equally capable in handling this distinction. So,

- you have a single Person named "Catherine Marshall"
- each place Catherine needs to be visible on the screen, you say something like

	institutionMorph addMorph: (PersonMorph for: (Person named: 'Catherine Marshall))
or
	projectMorph addMorph: (PersonMorph for: (Person named: 'Catherine Marshall))
or
	papersMorph addMorph: (PersonMorph for: (Person named: 'Catherine Marshall))

In the end, you will have one Person and several PersonMorphs. Each of the PersonMorphs will draw the necessary data from the single Person to do its job and if there is any interaction with one of those morphs (to update her c.v., e.g.), that interaction will be directed back to the Person so that all views (PersonMorphs) will know about the changes.

Cheers,
Bob





More information about the Squeak-dev mailing list