From: Robert Dober Date: 2010-04-30T22:20:47+09:00 Subject: Re: Switching dynamically between methods (inside modules) On Fri, Apr 30, 2010 at 2:57 PM, Robert Klemme wrote: > 2010/4/30 Rick DeNatale : >> To me, this problem cries out for delegation rather than inheritance >> or module inclusion. > > Absolutely! Ok can you kinda stop of spoiling the fun ;). I really did not analyze the use case. Delegation is often forgotten and often could be used instead of inheritance with beneficial effects. However, traits are behavior based on, well traits and *not* inheritance. I believe that traits are not really used anywhere in the spirit of the "original". If I am mistaken that would be a joyful surprise. And it would allow us to better study traits vs. x. In our case x being delegation. The question I would like to see answered is: Is it really the responsibility of a delegate to do the work? Look at where the data lives. In our case delegation is wonderful as there is an almost perfect decoupling of the language data. When the delegate needs many features of the delegator(sp?) however, traits become a really good alternative. And sorry for the advertising ;) > Cheers R. -- The best way to predict the future is to invent it. -- Alan Kay