Aspect-oriented programming examples [closed]

One of the examples which was loaned straight from this Aspect Oriented Programming: Radical Research in Modularity, Youtube video was painting to a display. In the example you have a drawing program, which consists of points, shapes, etc and when changes to those objects occur you need to tell the display to update itself. Without handling it in an aspect you end up repeating yourself quite a bit.

AOP, as I've understood it, was created for not repeating yourself for cross cutting concerns which might not have anything to do with business logic. With aspects you can modularize these concerns to aspects. One of the examples was logging but there are bunch of different things you might end up repeating. It has been evolving since and it's not any more about aspect-oriented programming but there's also aspect-oriented modelling.

More information about aspect oriented programming can be found from these sources:

  • to read:
    • Wikipedia - Aspect-oriented programming
  • to listen:
    • Software engineering radio - Episode 106: Introduction to AOP
    • Software engineering radio - Episode 11: Interview Gregor Kiczales
  • to watch:
    • Google Video - Anurag Mendhekar: Aspect-Oriented Programming (Dan Friedman's 60th Birthday)
    • Youtube - Aspect Oriented Programming: Radical Research in Modularity
    • Youtube - Aspect-Oriented Modeling - what it is and what it's good for

Security

  • Inject code that checks permissions and blocks access

Friendlier error msgs for asp.net webcontrols/webparts

  • Inject code that catches exceptions and writes stacktrace when debug-compiled or friendly messages when error-compiled (like the stuff here: Transparent generic exception handling for asp.net / MOSS2007 (with code) )

Performance

  • Inject code that sets perf counters to get an overview of where your app is slow