[Pharo-project] Why don't we always register weakly in SystemAnnouncer?

Mariano Martinez Peck marianopeck at gmail.com
Sat Jun 16 16:51:35 EDT 2012


Hi, with the help of Guille I noticed that normal instances usually
register weakly:

TestRunner >> initialize
.....
SystemAnnouncer current
        weak
        on: ClassAdded, CategoryAdded, ClassRemoved, CategoryRemoved,
ClassRenamed, CategoryRenamed, ClassRecategorized send: #update to: self.
.....

and classes don't:

TestCase class >> registerForNotifications
    ...
   SystemAnnouncer current on: MethodAdded, MethodModified, MethodRemoved
send: #methodChanged: to: self.

so..Guille told me this is because usually the cycle-life of instances is
short in comparisson with classes. But classes can be removed as well. What
happen then? the announcer will hold always a reference to an obsolete
class?
my question is, should we always use weakly? if not, why ?

thanks for the explanation,

-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120616/9110bf77/attachment.html>


More information about the Pharo-dev mailing list