From: Ruby Newbie Date: 2006-06-15T02:00:51+09:00 Subject: Re: Cut-based AOP ------=_Part_93469_12477808.1150304447507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Eric. As I see evil.rb, and Object#become - we're basically looking at object inheritance, which may get the job done in some cases, but violates the separation which AOP is attempting to provide/enforce. I'm new to AOP as well as Ruby, but strictly from an OOP persepective, I don't want to assume the responsibility for all methods of the parent for the purpose at hand - behavior monitoring / modification of 1-n methods of the class. On 6/14/06, Eric Mahurin wrote: > > On 6/14/06, Ruby Newbie wrote: > > Can you provide references to better and more-established ways of > offering > > such > > extensibility? I looked briefly at traits which you'd alluded to > earlier, > > but it requires changes to the core code for trait/hook insertion. I'm > > interested to read about other mechanisms which are more maintainable > and > > extensible than AOP in Ruby if you could please share them. > > Here is a way to get 99% of this cut-based AOP thing (that is > overengineered as Austin says): > > > http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/295923d21d6c1842/5034dcf0262ebc1e > > All you need is Object#become from evil.rb. You could write a few > wrappers to make this look prettier. > > I think if some AOP thing is added to ruby, it should be something > very simple that could be extended to some elaborate AOP framework > (rather than starting with an elaborate framework as trans suggested - > that includes new keywords!). Here are some of the simple things that > could be used as a a basis for AOP: > > - pre and post method hooks (what matz is planning) > > - Object#become/Class#replace. Can be implemented now in pure ruby ( > evil.rb) > > - something like Module#include except "super" (or something else) in > the included methods refers to the previous method definition. > > Eric > > ------=_Part_93469_12477808.1150304447507--