*** Welcome to piglix ***

Advice in aspect-oriented programming


In aspect and functional programming, advice describes a class of functions which modify other functions when the latter are run; it is a certain function, method or procedure that is to be applied at a given join point of a program.

The following is taken from a discussion at the mailing list aosd-discuss. Pascal Costanza contributed the following:

The term advice goes back to the term advising as introduced by Warren Teitelman in his PhD thesis in 1966. Here is a quote from Chapter 3 of his thesis:

"Advising" found its way into BBN Lisp and later into Xerox PARC's Interlisp.

It also found its way to Flavors, the first object-oriented extension to Lisp developed at MIT. They were subsumed under the notion of method combination. See, for example, AIM-602 at http://www.ai.mit.edu/research/publications/browse/0600browse.shtml 1

Since method combination and macros are closely related, it's also interesting to note that the first macro system was described in 1963, three years before Warren Teitelman's PhD thesis. See AIM-57 at http://www.ai.mit.edu/research/publications/browse/0000browse.shtml 2

The practical use of advice functions is generally to modify or otherwise extend the behavior of functions which cannot be easily modified or extended. The Emacspeak Emacs-addon makes extensive use of advice: it must modify thousands of existing Emacs modules and functions such that it can produce audio output for the blind corresponding to the visual presentation, but it would be infeasible to copy all of them and redefine them to produce audio output in addition to their normal outputs; so, the Emacspeak programmers define advice functions which run before and after.


...
Wikipedia

...