C#面向切面编程 [英] Aspect Oriented Programming in 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屋!