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:
Security
Friendlier error msgs for asp.net webcontrols/webparts
Performance
验证:
[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制作经验的人?
下一篇: 编程实例