.NET AOP(一)七种AOP实现方法

7Approaches for AOP in .Net

AOP在 .NET中的七种实现方法

Here are all the ways that I can think of to add AOPto your application. This mostly focus on the interception sideof things,because once you have that, everything else it just details.

在这里列表了我想到的在你的应用程序中加入AOP支持的所有方法。这里最主要的焦点是拦截,因为一旦有了拦截其它的事情都是细节。

Approach

方法

Advantages

优点

Disadvantages

缺点

Remoting Proxies

远程代理

Easy to implement, because of the .Net framework support

容易实现,因为有.NET框架的支持。

Somewhat heavyweight
Can only be used on interfaces or MarshalByRefObjects

微显重量级

仅在接口或MarshalByRefObjects 上使用

Derivingfrom ContextBoundObject

从ContextBoundObject 派生

Easiest to implement
Native support for call interception

很容易实现

原生支持调用拦截

Very costly in terms of performance

非常昂贵的性能代价

Compile-time subclassing
( Rhino Proxy )

编译时子类化

Easiest to understand

很容易理解

Interfaces or virtual methods only

仅用于接口或虚方法

Runtime subclassing
( Castle Dynamic Proxy )

运行时子类化

Easiest to understand
Very flexible

很容易理解

非常灵活

Complex implementation (but alreadyexists)
Interfaces or virtual methods only

复杂的实现(已经实现)

仅用于接口或虚方法

Hooking into the profiler API
( Type Mock )

分析 API钩子

Extremely powerful

极端强大

Performance?
Complex implementation (COM API, require separate runner, etc)

性能未知

复杂实现(COM API,需要单独运行等)

Compile time IL-weaving 
( Post Sharp / Cecil )

编译时 IL织入

Very powerful
Good performance

非常强大

良好的性能

Very hard to implement

实现非常困难

Runtime IL-weaving
( Post Sharp / Cecil )

运行时 IL织入

Very powerful
Good performance

非常强大

朗好的性能

Very hard to implement

实现非常困难

http://www.cnblogs.com/tenghoo/archive/2010/12/22/aop.html#commentform点击打开链

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值