What ever happened to Aspect Oriented Programming? [closed]

六月ゝ 毕业季﹏ 提交于 2020-11-30 07:58:24

问题


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.


回答1:


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.

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".

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.

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 :).

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




回答2:


That tends to happen with every "next big thing." Lots of hype, followed by a slow decline in the use of the buzzword. But, even though buzzwords fade and eventually disappear, whatever good ideas were behind them tend to stick around to be absorbed into the mainstream.

[Edit] Okay, an example for those who think I'm "bashing" something, or claiming that aspect oriented programming is going to disappear. At one time the next big thing was structured programming. Object oriented programming grew out of that, and now nobody talks about doing "structured programming" any more. But, in many ways we're still using its best ideas, because OOP adopted them, improved them, and added still more new ideas.




回答3:


It's around on some projects, my own experience on a recent project is that is too easy to abuse :( !!! What started a a nice way to setup debug, timing and to some extend transaction management, it quickly got corrupted to the weirdest, and hardest code to understand and debug that I've seen in a while.

just to expand a bit on the debug/diagnostic side, the stack traces generated by AOP code many times hide beyond recognition the actual place where the exception took place.




回答4:


AOP is actually truly brilliant, the problem with it is that no existing language has really great support for it. Sure C# has attributes (which only works when you're CODING the thing) and Java has "injection" (which creates a mess out of the runtime) but in general there are no (mainstream) languages which have truly great support for it...

So it kind of like ended up being a "Design Pattern" (with insanely different implementations in all the different languages though) which after all isn't all that bad I guess ;)




回答5:


I'm going to suggest that it wasn't big enough. It sounds very appealing, but does it really make coding any easier? I've been wanting to try it out and find what benefits it really holds, but I don't think I do enough coding where I need the relationships that it provides. I don't think it is as beneficial as it sounds.

Also at this point, making it easier to do multicore programming easier is a big thing and I don't think aspect-oriented programming will assist with that.

You can also find lots of content on Adoption Risks.



来源:https://stackoverflow.com/questions/316132/what-ever-happened-to-aspect-oriented-programming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!