C#中的面向方面编程 [英] Aspect Oriented Programming in C#

查看:29
本文介绍了C#中的面向方面编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么好的资源可以让我了解面向方面的编程?

Are there any good resources to wrap my head around Aspect Oriented Programming?

PS:我需要了解 AO 编程,而不是可用于 .NET 或 C# 的库或框架:)

PS: I need to understand AO programming, not the libraries or frameworks available for .NET or C# :)

推荐答案

只是想了解一下:它能够hook 事件,例如:创建对象、设置属性、等,并为它们附加通用功能,这些功能将填充相关上下文.

Just to get your head around it: It is the ability to hook events such as: creation of objects, setting of properties, etc, and attach general functions to them, that will be populated with relevant context.

因为 C# 没有为此内置工具,所以您需要一个框架,如 PostSharp,来进行字节码编织"(即,只需编写代码来实际进行调用,直接对您的类)来模拟它.

Because C# doesn't have an inbuilt facility for this, you need a framework, like PostSharp, to do 'bytecode weaving' (i.e. just writing code to actually make the calls, directly to your classes) to simulate it.

这篇关于C#中的面向方面编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆