overridding without subclassing examples

nicolas cellier ncellier at ifrance.com
Wed Sep 19 20:25:15 UTC 2007


Agents were already there in Squeak!
Thanks, i've learned something

Bert Freudenberg a écrit :
> In Squeak this is usually called "uniclasses" (for Unique Class) as a 
> way to add methods to instances. It's in the base system - send 
> #assureUniClass to the instance.
> 
> What's the difference of this to #becomeSingleton?
> 
> - Bert -
> 
> On Sep 19, 2007, at 3:50 , David Mitchell wrote:
> 
>> Nope. Not about the GoF Singleton pattern at all.
>>
>> More like Ruby singleton methods. Which is about an instance or
>> instances that have methods that aren't defined in the class for all
>> objects.
>>
>> http://map.squeak.org/accountbyid/04ec7571-cb7e-47ea-b1fc-218f7ec45adc/package/9d63f342-30e3-4db2-8695-3d65ccf28100 
>>
>>
>> "This package adds the #becomeSingleton method to Object, which will
>> transform the receiver into an instance of a new, anonymous subclass
>> of its original class. This lets you add or redefine methods on an
>> object-by-object basis."
>>




More information about the Squeak-dev mailing list