Hi all,
SmalltalkImage>>processShutDownList: sends #shutdown: to all classes in ShutDownList, yet there are classes that don't implement #shutdown: but #shutdown. One example is ExternalSettings class>>shutDown, ExternalSettings is in ShutDownList. Can someone explain how this is supposed to work or why there is no error when the image is shutting down?
Best, Fabio
On 28.12.2017, at 22:09, Fabio Niephaus lists@fniephaus.com wrote:
Hi all,
SmalltalkImage>>processShutDownList: sends #shutdown: to all classes in ShutDownList, yet there are classes that don't implement #shutdown: but #shutdown. One example is ExternalSettings class>>shutDown, ExternalSettings is in ShutDownList. Can someone explain how this is supposed to work or why there is no error when the image is shutting down?
Behavior>>shutDown: quitting "This message is sent on system shutdown to registered classes" ^self shutDown.
Best -Tobi
Best, Fabio
On Thu, Dec 28, 2017 at 10:20 PM Tobias Pape Das.Linux@gmx.de wrote:
On 28.12.2017, at 22:09, Fabio Niephaus lists@fniephaus.com wrote:
Hi all,
SmalltalkImage>>processShutDownList: sends #shutdown: to all classes in
ShutDownList, yet there are classes that don't implement #shutdown: but #shutdown. One example is ExternalSettings class>>shutDown, ExternalSettings is in ShutDownList.
Can someone explain how this is supposed to work or why there is no
error when the image is shutting down?
Behavior>>shutDown: quitting "This message is sent on system shutdown to registered classes" ^self shutDown.
Whoops, looks like I didn't see that one in the list of implementors. Thanks!
Best -Tobi
Best, Fabio
On Thu, 28 Dec 2017, Fabio Niephaus wrote:
Hi all, SmalltalkImage>>processShutDownList: sends #shutdown: to all classes in ShutDownList, yet there are classes that don't implement #shutdown: but #shutdown. One example is ExternalSettings class>>shutDown, ExternalSettings is in ShutDownList. Can someone explain how this is supposed to work or why there is no error when the image is shutting down?
It may be tempting to implement #shutDown when you don't need the argument, but I suggest you should not use it, ever. Why? Because if someone implements #shutDown: in a superclass of yours, your #shutDown method will (probably) not be sent, and tracking down such bugs is rather time consuming.
Same applies to #startUp.
Also, the argument is useful in almost all cases, it's just that people probably forgot to use it. That alone gives about a second overhead to image saving. So, please use the argument.
Actually both #shutDown and #startUp should be deprecated some way.
Levente
Best, Fabio
squeak-dev@lists.squeakfoundation.org