[squeak-dev] Re: Two methods sharing source code?

Klaus D. Witzel klaus.witzel at cobss.com
Thu May 29 15:10:03 UTC 2008


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).

> Is this possible in Squeak? And, would the usual tools work with that?

Trait has not so sophisticated tool support but it works for the case that  
you+me described.

/Klaus

> Regards,
> Martin
>
>





More information about the Squeak-dev mailing list