[squeak-dev] Re: MVC-Morphic refactoring, review needed

David T. Lewis lewis at mail.msen.com
Wed Nov 25 03:10:14 UTC 2009


Andreas, thank you for the feedback.

On Mon, Nov 23, 2009 at 08:34:42PM -0800, Andreas Raab wrote:
> David T. Lewis wrote:
> >I updated Project>>okToChange to remove Morphic/MVC dependencies. In the
> >process I elimated some logic that appears to serve no purpose. However,
> >this is code that existed in earlier versions of the method with a "di"
> >author stamp, so I am concerned that it may have been there for a reason
> >that I don't understand. If someone can review the change, I'd appreciate 
> >it.
> 
> Your change is perfectly fine as far as compatibility goes but I think 
> it's missing the mark somewhat, so let me explain:

Good, my primary concern was to make sure I did not break anything.

> That method currently determines when to delete a project based on 
> deleting its project view. I.e., when you create a project we're 
> currently creating a project link to enter the project, but you can also 
> create a link to the project from elsewhere. The logic assumes that it's 
> okay to delete project views from other projects than the original 
> parent, but will nuke the underlying project if the view is in the 
> original parent project. That seems flawed in more than one way - it 
> assumes that a view that comes from the original parent project it is 
> necessarily the "primary" view for this project and that deletion of 
> that view should also cause the project to be deleted. I think both are 
> wrong assumptions.

Yes, I see what you mean.

> Instead, what we should do is to make it so that deletion of projects is 
> explicit, via the menu action called "close project" (with confirmation 
> etc). Then you can get rid of all of that logic - it's always safe to 
> delete a project view since the underlying project will only be deleted 
> when you explicitly choose to.

I'm not sure I understand. Are you thinking of a menu action in the
world menu of the current project, or a menu action in the window menu
of the view on the project? (Or something that already exists that
I am overlooking?)

I think that it is still necessary to ensure that the project
is finalized when the last open view has been closed, at least in
the case of a Morphic project with Players and Wonderlands (I don't
know what the issues are, but the cleanup code must be there for
a reason).

So if the user closes the last open view on a project, I expect that
we still want the project to be automatically finalized, and we would
not want finalization to occur unless the view being closed was the
last open view on that project.

Does that sound right?

Dave




More information about the Squeak-dev mailing list