本文介绍了.NET仍在积极开发哪些面向方面的编程(AOP)库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一个相当成熟/稳定且免费的(最好是开源的)库来在.NET中进行AOP。我一直在搜索附近,发现以下产品;但是,其中大多数似乎已死:

I am trying to find a reasonably mature/stable and freely available (preferably open-source) library for doing AOP in .NET. I've been searching around a bit and found the products below; however, most of them seem dead:


  • —这是通常推荐用于.NET的AOP解决方案,但这是一种商业产品,因此存在一些使用限制。 (不过,它似乎可以免费用于个人或开源项目。)

  • PostSharp — this is the AOP solution usually recommended for .NET, however it's a commercial product and thus some use restrictions apply. (However, it seems to be sort-of freely available for personal or open-source projects.)

—不仅限于AOP,因此如果只想执行AOP可能功能太强大。 (?)

Spring.NET — not exclusively about AOP, so it's probably too powerful if one only wants to do AOP. (?)

Policy Injection Application Block — being from Microsoft, I would expect this to be at least maintained.

和—并非主要是AOP库,但显然可以用于该目的。

Castle Windsor together with DynamicProxy — not primarily an AOP library, but apparently it can be used for that purpose.

Aspect# — this seems quite dead to me.

Aspect.NET — this also seems quite dead to me.

NAop —显然不再受支持。

NAop — apparently no longer supported.

AOP.NET — this was supposed to be the successor to NAop, and also looks like it died a while ago.

甚至有可能是NAop的继承人。更多。从上面的列表中,我可以得出,在.NET上进行AOP的唯一真正选择是PostSharp(即使它是商业产品),Spring.NET,Microsoft的Policy Injection Application Block或Windsor。

There's probably even more. From the above list I gather that the only real options for doing AOP on .NET is PostSharp (even though it's a commercial product), Spring.NET, Microsoft's Policy Injection Application Block, or perhaps Windsor.

我忘了任何主要选择吗?

Did I forget any major option?

另请参阅问题,请参见StackOverflow 。我发布了一个新问题,因为我对.NET的各种AOP解决方案的开发/维护状态特别感兴趣。

See also the question Suggestions for open source aspect-oriented library for C# here on StackOverflow. I posted a new question because I'm specifically interested in the state of development/maintenance of various AOP solutions for .NET.

推荐答案

您不需要Windsor即可使用DynamicProxy。温莎将DynamicProxy用于自己的目的,就像NHibernate,RhinoMocks,Moq或其他库/应用程序/框架一样。
如果只需要运行时AOP,而没有IoC容器,则仅使用Caste DynamicProxy。

You don't need Windsor to use DynamicProxy. Windsor uses DynamicProxy for its own purposes, just like NHibernate, RhinoMocks, Moq or other libraries/applications/frameworks out there.If you need just runtime AOP, without IoC container, use Caste DynamicProxy alone.

它是积极开发的,上个预发行版是2周前发布的,

It is actively developed, last pre-release was released 2 weeks ago, final release (v2.5) is expected this month.

注意:在以前的版本(v2.2以下)中,DynamicProxy曾经存在于其自己的程序集Castle.DynamicProxy中。 .dll。后来将其移至Castle.Core.dll,现在不需要其他程序集即可使用它。

Note: In previous versions (up to v2.2) DynamicProxy used to live in its own assembly Castle.DynamicProxy.dll. It was later moved to Castle.Core.dll and now no other assembly is required to use it. Source

这篇关于.NET仍在积极开发哪些面向方面的编程(AOP)库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 09:38