AOP-私有,受保护的静态方法(.NET) [英] AOP- Private, protected, static methods (.NET)

查看:81
本文介绍了AOP-私有,受保护的静态方法(.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于.NET应用程序的DI + AOP。要求是设计用于记录的AOP,它将使用OUT-OF-BOX方法进行记录。我使用Castle Windsor DI + Castle Dynamic Proxy设计了组件。它工作得很好。


但是,这只适用于公共方法,因为它采用了拦截器方法的代理原则。我想实现私有,受保护,静态方法的日志记录。任何人都可以为我提供一种方法来实现这一目标吗?


谢谢


Tushar

解决方案

您可以使用现有框架;
http://www.codeproject.com/文章/ 28387 /开源评级 - AOP-Frameworks-in-NET


以前使用的是基于以下技术的本土版本  http://www.developerfusion.com/article/5307/aspect-oriented -programming-使用网/ 3 /


This is regarding DI+AOP for .NET Application. Requirement is to design AOP for logging which will take care of logging with OUT-OF-BOX approach. I have designed component by using Castle Windsor DI + Castle Dynamic Proxy. It works perfectly.

But, this works for Public methods only as per the proxy principle with interceptors approach. I want to achieve logging for Private, protected, static methods also. Could anyone provide me with an approach to achieve this with AOP in mind?

Thanks

Tushar

解决方案

Well you could use an existing framework; http://www.codeproject.com/Articles/28387/Rating-of-Open-Source-AOP-Frameworks-in-NET

Previously used a home-grown version that was based on the following technique  http://www.developerfusion.com/article/5307/aspect-oriented-programming-using-net/3/


这篇关于AOP-私有,受保护的静态方法(.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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