在这里列表了我想到的在你的应用程序中加入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

实现非常困难

(一)七种AOP实现方法的更多相关文章

  1. JS七种加密解密方法

    http://www.cnblogs.com/mq0036/p/4983858.html HTML或JS加密解密 本文一共介绍了七种方法:   一:最简单的加密解密   二:转义字符"\&q ...

  2. 七种css方式让一个容器水平垂直居中

    阅读目录 方法一:position加margin 方法二: diaplay:table-cell 方法三:position加 transform 方法四:flex;align-items: cente ...

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

    7Approaches for AOP in .Net AOP在 .NET中的七种实现方法 Here are all the ways that I can think of to add AOPto ...

  4. spring事务:事务控制方式,使用AOP控制事务,七种事务传播行为,声明事务,模板对象,模板对象原理分析

    知识点梳理 课堂讲义 1)事务回顾 1.1)什么是事务-视频01 事务可以看做是一次大的活动,它由不同的小活动组成,这些活动要么全部成功,要么全部失败. 1.2)事务的作用 事务特征(ACID) 原子 ...

  5. js刷新框架子页面的七种方法代码

    面以三个页面分别命名为framedemo.html,top.html,button.html为例来具体说明如何做.其中framedemo.html由上下两个页面组成,代码如下: <!DOCTYP ...

  6. Spring AOP propagation七种属性值

    <!-- 配置事务通知 --> <tx:advice id="advice" transaction-manager="transactionManag ...

  7. 用JavaScript刷新框架子页面的七种方法

    下面以三个页面分别命名为framedemo.html,top.html,button.html为例来具体说明如何做. 其中framedemo.html由上下两个页面组成,代码如下: < !DOC ...

  8. 斐波那契(Fibonacci)数列的七种实现方法

    废话不多说,直接上代码 #include "stdio.h" #include "queue" #include "math.h" usin ...

  9. SQL Server 优化存储过程的七种方法

    原文:SQL Server 优化存储过程的七种方法 优化存储过程有很多种方法,下面介绍最常用的7种. 1.使用SET NOCOUNT ON选项 我们使用SELECT语句时,除了返回对应的结果集外,还会 ...

随机推荐

  1. 剑指offer面试题4: 二维数组中的查找

    题目描述 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数 ...

  2. Golang入门教程(十四)结构体和类详解

    golang中并没有明确的面向对象的说法,实在要扯上的话,可以将struct比作其它语言中的class. 类声明 type Book struct { Title string Author stri ...

  3. 转载---滋滋有味看完的一篇文章关于python与java夜话

    这是一个程序员的电脑硬盘,在一个叫做"学习"的目录下曾经生活着两个小程序,一个叫做Hello.java,即Java小子:另外一个叫做hello.c ,也就是C老头儿. C老头儿的命 ...

  4. 059、安装配置flannel(2019-03-28 周四)

    参考https://www.cnblogs.com/CloudMan6/p/7424858.html   build flannel   flannel 没哟现成的执行文件可用,必须自己build,最 ...

  5. spring 循环依赖问题

    今天碰到一个问题,项目启动,初始化bean的时候,报下面的错: Bean with name ‘*********’ has been injected into other beans [***** ...

  6. postfix 指定用户限制指定域名收发

    main.cf 配置示例: smtpd_restriction_classes = local_in_only, local_out_only local_in_only = check_recipi ...

  7. dwr出现session error

    把项目冲tomcat6迁移到tomcat7之后,在项目运行中发现用到dwr的地方出现了session error错误, 网上搜了一下,是因为tomcat7的安全机制. 解决方法: 在项目的web.xm ...

  8. 第27月第10天 cmake

    1.error: tool 'xcodebuild' requires Xcode的解决办法 sudo xcode-select --switch /Applications/Xcode.app/Co ...

  9. 第27月第6天 gcd timer

    1.gcd timer 因为如果不用GCD,编码需要注意以下三个细节: 1.必须保证有一个活跃的runloop. performSelector和scheduledTimerWithTimeInter ...

  10. asp.net core处理中文的指南

    参考资料:https://docs.microsoft.com/en-us/aspnet/core/security/cross-site-scripting Customizing the Enco ...