openAsMorph refactoring (was Re: TestRunner Ui in 3.1)

Dan Ingalls Dan at SqueakLand.org
Thu Sep 20 19:55:35 UTC 2001


> >>>>> "Doug" == Doug Way <dway at riskmetrics.com> writes:
>Doug> Maybe there could also be an instance-side Model>>open method,
>Doug> which then does the isMorphic test and calls either openAsMorph
>Doug> or openInView.  (Model class>>open would just be "self new
>Doug> open".)  Or, maybe it should all stay on the class side.  Hmm,
>Doug> looking at the implementors of #openAsMorph and #open, I see
>Doug> they're mixtures of instance-side and class-side... more cleanup
>Doug> to do.  Any thoughts on this?

merlyn at stonehenge.com (Randal L. Schwartz)  replied...
>I said this a year ago.  So yes, do it.  There's no reason every
>single thing that "opens" should need to test what kind of world it's
>in.
>
>    If you type code twice, something's not proper,
>    if you type code thrice, it's a show-stopper!

At least for things that are Morphs, a solution already exists.  For instance

	CipherPanel new openInWorld

works in both MVC and Morphic. openInWorld is inherited by all Morphs, and many morphic apps use it (although I have just discovered some bit rot in testing this feature in MVC). 

This doesn't address models that want to open in StandardSystemViews or SystemWindow morphs depending on which world.  Anyway you might want to follow this pattern if you're going to implement something for that case.

	- Dan
-- 




More information about the Squeak-dev mailing list