面向方面的编程示例 [英] Aspect-oriented programming examples

查看:74
本文介绍了面向方面的编程示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以发布不是不是日志记录的面向方面的编程(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:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆