内置AOP在C#中 - 是它的方式是什么?它的、方式、AOP

2023-09-02 01:54:39 作者:Οo锋芒毕露оΟ

在大型的应用程序,我发现自己真的很希望我已经内置AOP设施。由于它矗立在C#中最好的,你可以做的是工厂和RealProxys,PostSharp,ICorDebug,ICorProfiler或注入框架。有做AOP的没有干净的内置方式。

In large apps I find myself really wishing I had built-in AOP facilities. As it stands in C# the best you can do is factories and RealProxys, PostSharp, ICorDebug, ICorProfiler or injection frameworks. There is no clean built-in way of doing AOP.

有任何迹象显示任何地方(博客文章/内部讨论),表明AOP是在路上?

Is there any indication anywhere (blog post / internal discussion) that indicates that AOP is on the way?

推荐答案

罗曼的答复盖(几乎是完美的:)当前的解决方案。至于未来的支持,安德斯·海尔斯伯格拥有的 previously说的they'were在等待和放大器;见模式有关AOP。

Romain's answer covers (almost :) perfectly the current solutions. As for the future support, Anders Hejlsberg has previously stated that they'were in wait & see mode about AOP.

我们只能希望,与CSC的管理重写,以及«编译器作为服务»,人们可以插到编译器,并注入方面有。

We can only hope that with the managed rewrite of csc, and a «Compiler as a Service», one could plug into the compiler, and inject aspects there.