[squeak-dev] Re: Two methods sharing source code?
Martin Beck
martin.beck at hpi.uni-potsdam.de
Thu May 29 15:16:32 UTC 2008
Klaus D. Witzel schrieb:
> On Thu, 29 May 2008 15:39:58 +0200, Martin Beck wrote:
>
>> Hi there,
>> for some reasons, I want to have two methods sharing the same source
>> code base. So if I change one method within the browser, the other
>> would change, too.
>
> Whenever I want that, I put the method(s) into a Trait and #use: that
> Trait in the respective classes. Later changing the Trait's method(s)
> also changes the Trait user's method (traits only recompiles its used
> methods if they do super send).
>
Yupp, I know that, but as my other post indicated, one half of these
classes or methods are part of the Collection hierarchy, which I of
course don't want to change... Otherwise, a trait would be a useful
solution, I agree.
Martin
More information about the Squeak-dev
mailing list
|