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

Hernan Wilkinson hernan.wilkinson at gmail.com
Wed Oct 14 05:33:45 PDT 2020


On Wed, Oct 14, 2020 at 9:27 AM Juan Vuletich via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> 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.
>

fine with me


>
>  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.
>

Ok... we have a lot of packages outside the cuis-smaltalk repo but that
will help.
It would be nice to have a better source code management system where those
changes are applied automatically... anyway, just missing OOSCM

Hernan.

>
> Thanks,
>
>
>  Cheers!
>  Hernan.
>
> On Tue, Oct 13, 2020 at 5:22 PM Juan Vuletich <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
>> 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 Vuletichwww.cuis-smalltalk.orghttps://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Devhttps://github.com/jvuletichhttps://www.linkedin.com/in/juan-vuletich-75611b3
> @JuanVuletich
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201014/af1ceb34/attachment.htm>


More information about the Cuis-dev mailing list