oriented programming examples

Can anyone post an example of Aspect-oriented programming (AOP) that is not logging?

I've looked at several resources but all the examples are trivial logging. What is it useful for?


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

  • 验证:

    [NotNull]
    public string Property1 { get; set; }
    
    [Length(Min = 10, Max = 20)]
    public string Property2 { get; set; }
    
    [Regex(Expression = @"[abc]{2}")]
    public string Property3 { get; set; }
    
    链接地址: http://www.djcxy.com/p/95162.html

    上一篇: 任何拥有Postharp制作经验的人?

    下一篇: 编程实例