From: Stephen White Date: 2001-08-23T13:26:31+09:00 Subject: [ruby-talk:20158] Re: Another Possible RCR - Wrappers via Mixins On 23 Aug 2001 12:27:21 +0900, Dave Thomas wrote: > Except... let's not call it 'super' as that's kind of misleading. How > about 'inner', or 'chain'? I'm visualising this as: There is a class, which has variables and methods. Calls to this class "fall through" to the parent class. If the class has defined the method as well, this method can wrap the parent method, eg: class Test1 def test str puts str end end class Test2 < Test1 def test str puts "1" super puts "2" end end Test2.new.test "hello world" should (I didn't test this) print 1 hello world 2 A mixin wrapper would be the next step down, with its methods coming before the class methods. Making a 'super' call from a wrapper is going in the same direction as the class super. I can't think of a good way to say what I have in mind - "parent, child, grandchild" doesn't work. It's more like "skeleton, body, clothes". :) I did think of a downside... The original class would have to be modified to have "include Mixin", whereas AspectR can layer across from outside. There would also have to be a few support routines to implement some of AOP's other ideas like pattern matching on method names.