面向方面的编程发生了什么? [英] What ever happened to Aspect Oriented Programming?

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

问题描述

我记得在1990年代末和2000年代初,面向方面编程(AOP)被认为是下一件大事".如今,我仍然看到一些AOP,但它似乎已经淡出了背景.

I remember that in the late 1990s and early 2000s Aspect Oriented Programming (AOP) was supposed to be the "Next Big Thing". Nowadays I see some AOP still around, but it seems to have faded into the background.

推荐答案

在2000年代初期,可能发生了很多炒作,而发生的事情如下:已经进行了很多尝试来创建面向方面的框架,这些尝试已合并到Java领域的两个重要项目中:AspectJ和Spring AOP.AspectJ是完整的,复杂的,学术性的,有些过分设计.Spring AOP涵盖了80%的用例,而复杂性则为20%.

There has maybe been a lot of hype in the early 2000's, and what happened is the following: there has been a lot of attempts to create aspect-oriented frameworks, and these attempts have merged into two significant projects in the Java sphere: AspectJ and Spring AOP. AspectJ is complete, complex, academic, somewhat overengineered. Spring AOP covers 80% of use cases with 20% of complexity.

如果您查看Google趋势中的术语,然后将其与Java本身的流行度进行比较,您会发现AspectJ的相对流行度在一定程度上是恒定的,但是Spring AOP正在提高.这意味着人们使用AOP,但不希望AspectJ的复杂性.我认为AspectJ的创建者犯了很多战术错误;AspectJ一直是一个研究项目,并不是为大众设计"的.

If you look at Google Trends for terms "AspectJ, Spring AOP", then compare to the popularity of Java itself, you will see that the relative popularity of AspectJ is somewhat constant, but Spring AOP is raising. That means that people use AOP, but don't want the complexity of AspectJ. I think that the creators of AspectJ made a lot of tactical mistakes; AspectJ has always been a research project and has not been designed "for the masses".

在.NET领域,在2000年代初期,我们对AOP产生了类似的兴趣.在2003年,当我开始AOP研究时,.NET上有六个AOP编织器.所有人都遵循AspectJ的道路,而且都处于婴儿期.这些项目都没有幸存下来.基于此分析,我构建了PostSharp,其目的是覆盖80%的用例和20%的复杂性,但使用起来比Spring AOP方便得多.现在,PostSharp被认为是.NET的主要编织者.PostSharp 2.0建立在5年的反馈和AspectJ行业经验的基础上,并带来了企业就绪"的AOP(未来将判断此声明是否应得).除了PostSharp之外,其他重要的参与者还有.NET的Spring框架和Windsor Castle,这两个以DI为中心的应用程序框架提供了还"方面(方面被视为注入到构造对象中的依赖项).由于这些技术使用运行时编织,因此存在严格的技术限制,因此实际上它们只能在服务对象中使用(这是为这些应用程序框架设计的)..NET中的另一个启动项目是LinFu,它可以执行也"方面的操作.

In the .NET sphere, we have seen a similar interest for AOP in the early 2000's. In 2003, when I started AOP researches, there were half a dozen of AOP weavers for .NET; all were following the path of AspectJ, and all were in infant stage. None of these projects survived. Based on this analysis, I built PostSharp, who was designed to cover 80% of use cases with 20% of complexity, and yet was much more convenient to use than Spring AOP. PostSharp is now considered the leading aspect weaver for .NET. PostSharp 2.0 builds on 5 years of feedback and from industry experience of AspectJ and brings "enterprise-ready" AOP (future will judge if this claim is deserved). Besides PostSharp, other significant players are Spring Framework for .NET and Windsor Castle, two DI-centric application frameworks providing 'also' aspects (aspects are considered as dependencies injected into constructed objects). Since these technologies use runtime weaving, they have severe technical limitations, so practically they can be used only in service objects (that's what these application frameworks have been designed for). Another starting project in .NET is LinFu, which can do 'also' aspects.

简而言之,AOP领域在去年进行了整合,并可能进入了生产力阶段:客户之所以使用它,是因为它确实节省了金钱,而不是因为它很酷.即使很酷:).

To be short, the AOP landscape has undergone some consolidation last years, and probably enters the phase of productivity: customers will use it because it really saves money, not because it is cool. Even if it is very cool :).

哦,我忘记了:大多数应用服务器都内置了对AOP的支持.考虑JBoss,WebSphere,以及某种程度上的WCF.

Oh, and I forgot: most application servers have built-in support for AOP. Thinking of JBoss, WebSphere, and, to some extent, WCF.

这篇关于面向方面的编程发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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