I would argue that is a bit more problematic than just applying the 
pointcuts onto the new methods.

If AOP were only about interception, that would be an all ok approach to 
just apply the cuts as soon as a new method appears.

however AOP != interception
your aspect might rely on some mixed in state, and that state might be 
the result of a chain of actions done onto the subject.

if a new method is added to the subject, and you re-apply the cuts, you 
would also have to put the mixed in state for the aspect in a valid 
mode.

a very simple example:

lets pretend we have an aspect that cuts every getter in a class in 
order to apply "lazy load".
in order to do this, we need to mixin a state holder for the subject, so 
that we know in which state each property is, eg "not loaded" and 
"loaded"

when the subject is fresh, all the properties (attributes in ruby) might 
be marked as "not loaded"

and when you access a few of them they change their status to "loaded"

now lets assume that we add a new method(a getter method)

First of all, do we even want the lazy load cut to be applied to this 
method?
the cut might have said "Cut all getters in the class" because when the 
cut was defined there were only a few properties in the class, and all 
of them were mapped to a DB.
its highly unlikely that you would add a getter that is also mapped to 
the db at runtime.
So the cut might be valid at one point but invalid once you add new 
methods.

but if we pretend that that was the case.
what state should that property have in the LazyLoad mixin?
loaded? , not loaded?

you might say "not loaded"
but what if the getters member var had a value assigned to it to when 
the method was added, in that case maybe the getter should be treated as 
"loaded"?

and when and where should that state be applied?
should the state mixin have some sort of mechanism to deal with new 
methods beeing added?

So the problem of added methods is not just about re-evaluating the 
cuts, you must also deal with state of the subject.

//Roger

-- 
Posted via http://www.ruby-forum.com/.