On 4 June 2013 00:52, David T. Lewis lewis@mail.msen.com wrote:
From the point of view of getting rid of #isMorphic, you are right that it
would be better to implement MVCProject>>createViewIfAppropriate, as well as this:
Project>>createViewIfAppropriate ^self subclassResponsibility
I'm not sure if the change carries its weight though. This does not seem like something that needs to be part of the Project API, and refactoring it may make it harder to understand what happens in #makeExistingView:project:projectsToBeDeleted: in the event that someone tries to use it in MVC.
This seems to be an Etoys method in which the #isMorphic test serves to document a bad thing that is going to happen if you were to use it in MVC (if you need to create the new view, you will enter that view and never execute the remainder of the method).
The call to #isMorphic may be bad but I think that adding unnecessary vocabulary to Project is undesirable, so in balance I would vote to not change the method.
I do suspect that a better refactoring is possible, but I don't know enough about how the project loading should work to suggest something.
Dang. I agree with you, and am keen to hear other proposals. I dislike the #isMorphic call, but mainly I'm trying to lose the ProjectView reference. This is one of, if I recall correctly, two references to the ST80 package in the base image.
frank
Dave
On Mon, Jun 03, 2013 at 11:42:50PM +0100, Frank Shearar wrote:
Normally I would, but this is more complicated than a simple moving of a method. I don't know the how this method's used so I've assumed that proj is a Project-like thing, and there are no tests for this code (that I can see).
So I thought I'd ask before telling... this time :)
frank
On 03 Jun 2013, at 19:27, Nicolas Cellier nicolas.cellier.aka.nice@gmail.com wrote:
tell don't ask ;)
2013/6/3 Frank Shearar frank.shearar@gmail.com I just found this method. It contains this snippet:
Smalltalk isMorphic ifTrue: [ proj createViewIfAppropriate. ] ifFalse: [ ChangeSorter allChangeSets add: proj changeSet. ProjectView openAndEnter: proj. "Note: in MVC we get no further than the above" ].
Wouldn't that be better written by implementing
MVCProject >> #createViewIfAppropriate ChangeSorter allChangeSets add: proj changeSet. ProjectView openAndEnter: proj.
and ripping out the #isMorphic call?
frank