On Sunday 20 January 2008, Christophe Porteneuve wrote:
> The trick here is to take an existing method and turn it into the
> same method that also fires a custom event.  That's AOP, and in
> Prototype you can achieve that with the wrap method.

No, it's not. Function#wrap is very convenient, but it is not AOP. If 
anything, it is method combination[1], a forerunner of AOP that 
predates it by some 10 or 20 years.

An essential part of AOP is quantification over join points, meaning you 
can express things like this

- Wrap a function around (or before, after) *all* functions (methods) of 
a parcticular class.
- Execute a function around (or before, after) any call to a specific 
function that happens within a particular module.
- Execute a function around (or before, after) any call to a specific 
function that is called within or somewhere below another given 
function.

My purpose here is twofold. For one thing, I detest the dilution of 
terminology. More importantly, I thing it's doing people a disservice 
telling them that Function#wrap (around method combination) is all 
there is to AOP; there is more to be had, indeed, more to be wanted, 
and good reason not to be content with just #wrap.

Michael

[1] http://www.lisp.org/HyperSpec/Body/glo_m.html#method_combination
[2] http://en.wikipedia.org/wiki/Aspect-oriented_programming
-- 
Michael Schuerig
mailto:[EMAIL PROTECTED]
http://www.schuerig.de/michael/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to