[squeak-dev] Class#category implementation

Thomas Kowark thomas.kowark at gmx.de
Tue Mar 10 16:04:01 UTC 2009


Thanks for the quick response. However, I still am wondering when this  
cache could be invalid?
Is it possible to change the category without the 'category' instance  
variable of class being set to the new value as well?

Thomas


On Mar 10, 2009, at 4:51 PM, Bert Freudenberg wrote:

>
> On 10.03.2009, at 16:34, Thomas Kowark wrote:
>
>> Hi,
>>
>> Today I stumbled upon the implementation of the category method in  
>> Class. It performs a lookup to check whether the name stored in the  
>> instance variable is still correct. I have performed some tests,  
>> changed the category names back and forth, and it always was  
>> correct. So what is the purpose of this kind of implementation?  
>> When can a category name change without the instance variable being  
>> set to the same value?
>
>
> Classes are put into categories by the SystemOrganizer. This  
> instance variable is just a cache, because looking up the category  
> in the organizer is slow. The implementation ensures the cache is  
> valid.
>
> - Bert -
>
>




More information about the Squeak-dev mailing list