[squeak-dev] SystemWindow #knownName violates principle of least astonishment

Marcel Taeumel marcel.taeumel at hpi.de
Wed Dec 13 08:22:48 UTC 2017


Hi John-Reed, hi Tobias,

I think that this is not the SystemWindow's fault but "name" as a concept for morphs is kind of broken. See the following methods in the Morph class:

#innocuousName
#name:
#nameInModel
#setNameTo:
#tryToRenameTo:
#knownName
#renameInternal:
#renameTo:
#externalName

I suspect that this has happened due to missing task-specific means of configuration. Like #printString, there can only be one to be used by all applications and tools. Here, the terms "internal" and "external" and "known" suggest that somebody tried to add such kind of configuration for "name". Without success, I would conclude. :-)

Best,
Marcel
Am 13.12.2017 03:00:50 schrieb John-Reed Maffeo <jrmaffeo at gmail.com>:
Tobias,

The application I am building uses #SystemWindow. The window has a model which contains the application program logic. One of the methods in my model wants to access the #SystemWindow so I gave it a name. When I tried to access the system window by name I got the label of the window and not the name  I gave it (I was astonished!). As I dug through the code, I saw that the #knownName methods in #Morph and #SystemWindow return different values. 

Note: I am still a newbie andMorphic has been a mystery to me for a long time .

I can work around the issue, but I was surprised, and confused by the fact that I was not getting the result I expected when I tried to access my application system window by the  name I had given it. My design is probably bollocks and I don't really need to access the system window from the model, but I thought it was something deserved review.

http://wiki.c2.com/?PrincipleOfLeastAstonishment [http://wiki.c2.com/?PrincipleOfLeastAstonishment]


Thanks for taking and interest,

-jrm



On Tue, Dec 12, 2017 at 5:51 PM, Tobias Pape <Das.Linux at gmx.de [mailto:Das.Linux at gmx.de]> wrote:


"SystemWindow #knownName violates principle of least astonishment"

Care to explain?

Best regards
        -Tobias


> On 12.12.2017, at 22:33, John-Reed Maffeo <jrmaffeo at gmail.com [mailto:jrmaffeo at gmail.com]> wrote:
>
> SystemWindow
> knownName
>
> ^label
>
> ___________
>
> Morphic
> knownName
>       "answer a name by which the receiver is known, or nil if none"
>       ^ extension ifNotNil: [extension externalName]
>
> _____________
>
> I modified and tested the attached.
>
> -jrm

> <SystemWindow-knownName.st>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171213/53336579/attachment.html>


More information about the Squeak-dev mailing list