[squeak-dev] What about "self currentProject"?

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Mar 2 13:30:02 UTC 2021


Hi Marcel,


could you maybe share some more details about this particular design goal of Newspeak? :-)


At the first glance, I do not really see the advantages of moving more and more "global getters" to Object. It:

- inflates the Object protocol even more

- might imply that there is some connection between the receiver and the project, or at least hide the global state (which one also could call "code perfuming" :-))

- and I don't see how it could help to replace the global object at all - you still need to wrap relevant calls with #becomeActiveDuring:, or speaking more in general about the proposed idiom, you would still need something like method wrappers unless you only want to override #currentThing for a single instance.


So what possible advantages am I missing right now? :)


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 2. März 2021 10:03:02
An: squeak-dev
Betreff: [squeak-dev] What about "self currentProject"?

Hi all!

After typing "Project current" for the n-th time, I was wondering, whether "self currentProject" could be a nice little idiom for the Squeak environment.

We had several thoughts on this matter:
http://forum.world.st/Object-gt-gt-currentProjectWorld-td5044161.html#a5045072
http://forum.world.st/Changeset-Eliminating-global-state-from-Morphic-tp5121690p5123334.html

1. Object >> #currentProject would be a *System extension in Object to not be dependent on Morphic.
2.  "Project current world" could be replaced with "self currentProject world" (generic) or "self currentWorld" (specific to Morphic).
3. "Project uiManager" could be replaced with "self currentProject uiManager".
4. "Project current addDeferredUIMessage:" could be replaced with "self currentProject addDeferredUIMessage:".

So, we wouldn't have so many class references to "Project" in the code. It kind of reminds me about some of Newspeak's design goals. :-)

What do you think?

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210302/c307e8bf/attachment.html>


More information about the Squeak-dev mailing list