From: Avi Bryant Date: 2001-03-06T13:07:51+09:00 Subject: [ruby-talk:12084] Re: Ruby & AOP On Tue, 6 Mar 2001, Dave Thomas wrote: > Avi Bryant writes: > > > A lot of the discussion has been hovering around basically this question - > > what would be the cleanest/most useful primitive for doing AOP or AOP-like > > things? advice.c was my first try at such a thing, but I'm not entirely > > happy with it. Something like "called" might be good - ideally usage > > would be something like > > Perhaps we've already got an interface, it just isn't used... > > If every method was dispatched via Object#send, then we could hook it > at all levels. Yes, that was my initial thought... the concern I had with that is that then any methods explicitly called with send() get the overhead of the advice mechanism; my assumption was that this mechanism would only want to be enabled for certain methods. It also then really needs to be done in the internals of the interpreter, to avoid the whole name-mangling issue. But that's certainly the cleanest way of doing it. If this is turning into an RCR, I second it. Avi