[Cuis-dev] [RFC][Proposal] A possible refactor of the Morph hierarchy

Juan Vuletich juan at jvuletich.org
Wed Oct 14 05:27:09 PDT 2020


On 10/14/2020 8:58 AM, Hernan Wilkinson via Cuis-dev wrote:
> Hi Juan,
>  I like the idea, I also have problems understanding those classes and 
> the names are not good as you say.
>  Regarding StringMorph renamed to LabelMorph, shouldn't it be 
> LabelWidget? or will it be a subclass of Morph? ... if it will be a 
> subclass of WidgetMorph, I would call it LabelMorph or LabelWidget.

All widgets should be in the WidgetMorph hierarchy. WidgetMorph is 
subclass of Morph. But using the suffix 'Widget' for Label means it 
should also be used for all the other Widgets, that are almost all of 
the Morph hierarchy. I'd leave it with a 'Morph' suffix, at least for now.

Phil said he'd prefer not to rename it, and leave it as StringMorph. If 
no one has strong opinions, we can ditch that idea.

>  Regarding the migration, I think we have to find a way for all the 
> current packages to be aware of these changes...  It would be great to 
> have all the affected packages loaded so when renaming the classes 
> that would rename all its references in packages and then you could 
> provide the changes of them... do you see that possible? (of course 
> that what it means all packages has to be decided). If not, we need to 
> look for a way to facilitate the migration.

What I always do is do these kind of changes after loading 
AllPackages.pck.st. This includes all the repos in the Cuis-Smalltalk 
GitHub organization. So, I also update all those packages. But I don't 
check any packages besides those.

In any case, I'm also suggesting a DeprecatedMorphs.pck.st package.

Thanks,

>
>  Cheers!
>  Hernan.
>
> On Tue, Oct 13, 2020 at 5:22 PM Juan Vuletich <juan at jvuletich.org 
> <mailto:juan at jvuletich.org>> wrote:
>
>     On 10/13/2020 2:44 PM, Phil B via Cuis-dev wrote:
>     > Juan,
>     >
>     > Not wild about the StringMorph->LabelMorph idea... looks like
>     > rearranging the lawn furniture to me as the existing name seems
>     > accurate and clear.
>
>     Ok. Let's listen to other opinions. Leaving it like it is is also
>     ok for me.
>
>     > Re: the rest, hopefully the final step would be to merge
>     > RectangleLikeMorph and BorderedRect back into RectangleMorph and
>     move
>     > it to someplace like goodies.
>
>     I think we can do better than that. RectangleLikeMorph and
>     BorderedRect
>     can't be rotated, for instance. We'd include a basic library of
>     vector
>     graphics shapes to play with. We're slowly walking in that direction.
>
>     > The first question new users often have re: Morphic is 'how do I
>     > instantiate or create my own Morph?' and a clean RectangleMorph
>     would
>     > provide that as a trivial Morph for instantiating and subclassing.
>     > (i.e. rather than deprecating it and prolonging the confusion/pain,
>     > keep a cleaned up version around specifically for tutorials/testing
>     > where you don't have to worry about features creeping in over the
>     > years breaking things)
>
>     I agree with the concern, but I don't like RectangleMorph or
>     BorderedRectMorph for that. Squeak has a pretty nice set of morphs to
>     play with. Cuis doesn't include them because they look ugly without a
>     good vector engine, and because the implementation of scaling and
>     rotation is not good enough. VectorGraphics allows to do all that and
>     more, with nicer code and better looks.
>
>     > Also, make sure the widget class is explicitly documented as
>     abstract
>     > just like Morph should be (how many times have we had people
>     confused
>     > about why instantiating Morph has problems?)
>
>     But Morph, RectangleMorph and BorderedRectMorph, all can be
>     instantiated
>     and used. If something breaks, please tell.
>
>     >
>     > Thanks,
>     > Phil
>     >
>
>     Thanks,
>
>     -- 
>     Juan Vuletich
>     www.cuis-smalltalk.org <http://www.cuis-smalltalk.org>
>     https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
>     https://github.com/jvuletich
>     https://www.linkedin.com/in/juan-vuletich-75611b3
>     @JuanVuletich
>
>
>
> -- 
> *Hernán Wilkinson
> Agile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201014/a5116838/attachment-0001.htm>


More information about the Cuis-dev mailing list