[squeak-dev] #shutdown vs #shutdown:

Levente Uzonyi leves at caesar.elte.hu
Fri Dec 29 20:40:45 UTC 2017


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


More information about the Squeak-dev mailing list