开发者

Best Aspect Oriented Framework for features / build performances in .net [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

Improve this question

In various projects I worked with, we had to use some AOP or dependency injection framewo开发者_StackOverflowrk.

We used Enterprise LIbrary, Unity and PostSharp.

For now, Postsharp is my best choice when it comes to the flexibiity I get over how I generate my aspects.

The only problem is the build time required once PostSharp is installed. My developpers don't like to pay the time tax even in regard of all the godness comming from PostSharp.

So my question is : What AOP framework would you recommand for fast build time AND great fonctionnality ?

Thanks, your answers are greatly appreciated,

Patrick


PostSharp is a basically a full featured static weaver. That means the weaving takes place during the build process, in a post-compilation step. And for sure, it can takes some time. (Be sure to read Gael announcement about runtime performance improvements and build time performance improvements that will come with the version 2.0)

If you don't want any build time overhead, there is only one solution : use dynamic weavers. In .NET, there are several interception frameworks, like Castle.DynamicProxy, or Linfu.DynamicProxy. They generate proxies at runtime. Be aware that theses frameworks can't do as much as a static AOP framework like PostSharp can, and may also perform less efficiently at runtime. Very often, IoC frameworks offer dynamic interception capabilities (Spring.NET, Unity, Windsor, etc.)

One other solution is to look at hybrid weavers, which only weaves join points during the build process, in a static manner, and then allow you to apply aspect dynamically at runtime. Linfu.AOP, which uses Mono.Cecil as a backend, works like that.


Spring.NET doesn't use weaving and it is based on a very stable Java aop framework. Here's the project address.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜