关于Castle中AOP的一个问题,急!!
1 <facility id="aspectsharp" type="Castle.Facilities.AspectSharp.AspectSharpFacility, Castle.Facilities.AspectSharp">
2 <![CDATA[
3 import FWL.Component
4 import FWL.Service.Interface in FWL.Service
5
6 interceptors [ "logger" : LoggerInterceptor ]
7 interceptors [ "security" : SecurityCheckInterceptor ]
8
9 aspect InterfaceLogger for [ assignableFrom(IUserService) ]
10 include SecurityMixin
11 pointcut method(*)
12
13 advice("logger")
14 end
15 end
16 ]]>
17 </facility>
2 <![CDATA[
3 import FWL.Component
4 import FWL.Service.Interface in FWL.Service
5
6 interceptors [ "logger" : LoggerInterceptor ]
7 interceptors [ "security" : SecurityCheckInterceptor ]
8
9 aspect InterfaceLogger for [ assignableFrom(IUserService) ]
10 include SecurityMixin
11 pointcut method(*)
12
13 advice("logger")
14 end
15 end
16 ]]>
17 </facility>
可能通过以上的配置,可以对所有继承了IUserService接口的类,实现AOP的功能,但现实中,有很多类似IUserService这样的业务功能接口,难道要一个个的写吗?还有其它的方法吗?比如针对一个程序集来控制?
不知道哪位有这方面的经验 ??
由于比较急,暂放首页一会。