(一)七种AOP实现方法
?在這里列表了我想到的在你的應(yīng)用程序中加入AOP支持的所有方法。這里最主要的焦點是攔截,因為一旦有了攔截其它的事情都是細節(jié)。
| Approach 方法 | Advantages 優(yōu)點 | Disadvantages 缺點 |
| Remoting Proxies 遠程代理 | Easy to implement, because of the .Net framework support 容易實現(xiàn),因為有.NET框架的支持。 | Somewhat heavyweight 微顯重量級 僅在接口或MarshalByRefObjects 上使用 |
| Derivingfrom ContextBoundObject 從ContextBoundObject 派生 | Easiest to implement 很容易實現(xiàn) 原生支持調(diào)用攔截 | Very costly in terms of performance 非常昂貴的性能代價 |
| Compile-time subclassing 編譯時子類化 | Easiest to understand 很容易理解 | Interfaces or virtual methods only 僅用于接口或虛方法 |
| Runtime subclassing 運行時子類化 | Easiest to understand 很容易理解 非常靈活 | Complex implementation (but alreadyexists) 復(fù)雜的實現(xiàn)(已經(jīng)實現(xiàn)) 僅用于接口或虛方法 |
| Hooking into the profiler API 分析 API鉤子 | Extremely powerful 極端強大 | Performance? 性能未知 復(fù)雜實現(xiàn)(COM API,需要單獨運行等) |
| Compile time IL-weaving? 編譯時 IL織入 | Very powerful 非常強大 良好的性能 | Very hard to implement 實現(xiàn)非常困難 |
| Runtime IL-weaving 運行時 IL織入 | Very powerful 非常強大 朗好的性能 | Very?hard to implement 實現(xiàn)非常困難 |
轉(zhuǎn)載于:https://www.cnblogs.com/chenh/p/9917975.html
總結(jié)
以上是生活随笔為你收集整理的(一)七种AOP实现方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 太塞心了!今天今日说法,那亲妈绑着女儿六
- 下一篇: 创造与魔法雪狼王怎么抓?