问题描述
任何人都可以发布不是不是日志记录的面向方面的编程(AOP)示例吗?
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?
推荐答案
直接从此面向方面的编程:模块化的基础研究,Youtube视频正在绘制到显示器上.在该示例中,您有一个绘图程序,该程序由点,形状等组成,并且当这些对象发生更改时,您需要告诉显示器进行更新.如果不进行某些方面的处理,您最终会重复很多次.
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的创建是为了避免重复涉及跨领域的问题,而这些问题可能与业务逻辑无关.使用方面,您可以将这些关注点模块化为方面.示例之一是日志记录,但最终可能会重复很多不同的事情.此后一直在发展,它不再是面向方面的编程,而是面向方面的建模.
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
- Software engineering radio - Episode 106: Introduction to AOP
- Software engineering radio - Episode 11: Interview Gregor Kiczales
- 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
这篇关于面向方面的编程示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
- to read: