From: Robert Klemme Date: 2010-04-30T22:45:53+09:00 Subject: Re: Switching dynamically between methods (inside modules) 2010/4/30 Robert Dober : > 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 ;). How can I stop you from having fun? It's a free world and you can do whatever pleases you. > I really did not analyze the use case. Delegation is often forgotten > and often could be used instead of inheritance with beneficial > effects. Exactly Rick's and my point. > 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. I would look a bit further into this if I had enough time right now. I have to admit I don't really have a firm grip on traits so I would have to do some research upfront to be able to properly comment on that matter. > 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 ;) No sweat. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/