[squeak-dev] Class#category implementation

Bert Freudenberg bert at freudenbergs.de
Tue Mar 10 15:51:34 UTC 2009


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