AOP programming in .Net? [closed]

眉间皱痕 提交于 2019-12-09 13:55:00

问题


I'm wondering what's good out there for AOP / crosscutting in .Net, along the lines of AspectJ. I see Microsoft has a Policy Injection Application Block; any other good stuff out there I should take a look at?


回答1:


PostSharp is probably the most popular option, although I believe Sprint.NET is fairly widespread, as well.




回答2:


I use Microsoft Unity but there is also StructureMap, Spring.NET, Castle Windsor and, the most popular, PostSharp.




回答3:


Let's not forget LinFU. Scott Hanselman did a great interview about it, including a lot of basics of AOP.




回答4:


I know of PostSharp which seems to be doing a lot of AOP-things really well using attributes.




回答5:


Spring.Net has an AOP framework which can be used with or without Spring's IoC framework. If you are also looking for an IoC framework, Spring.Net makes a compelling case and is free and open source.

Another plus for Spring.Net IMO is that the documentation and forum support really is excellent. One negative comment about Spring.Net that I have seen several times is that the XML configuration is wordy and difficult to read, which is true. It is however at least consistent so that once you have learned how it works for one block, you can apply it easily to other blocks.




回答6:


Delphi Prism has compiler support for AOP

http://prismwiki.codegear.com/en/Cirrus




回答7:


Interception extension for Microsoft Unity gives you some AOP. In addition, see Policy Injection as one of the out-of-the-box interception behaviours.

Good examples and tutorials are included in this set of Hands-on Labs.



来源:https://stackoverflow.com/questions/2031845/aop-programming-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!