我刚接触Spring AOP,正在阅读有关切入点设计器的文档。对我来说,this和target设计器听起来很相似。有人能用更好/更清晰的例子解释一下吗?谢谢
this - 将匹配限制为加入点(在使用Spring AOP时执行方法)其中bean引用(Spring AOP代理)是给定类型的实例
eg: this(com.xyz.service.AccountService)
任何一个连接点(仅在Spring AOP中方法执行)都需要代理实现AccountService接口:
目标 - 将匹配限制为连接点(使用Spring AOP时方法的执行),其中目标对象(被代理的应用对象)是给定类型的实例
eg: target(com.xyz.service.AccountService)
任何连接点(仅在Spring AOP中是方法执行),其中目标对象实现了AccountService接口。
链接: http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/aop.html