声明式增强
声明式增强:借助Spring IOC的机制,为ProxyFactory代理工厂的属性实现依赖注入,这样做的优点是可配置型高,易用性好。
实例:
DoSomeService接口:
DoSomeServiceImol实现类:
BeforAdvice增强类:
Application-statemenr.xml文件:
测试:
结果:
声明式增强:借助Spring IOC的机制,为ProxyFactory代理工厂的属性实现依赖注入,这样做的优点是可配置型高,易用性好。
实例:
DoSomeService接口:
DoSomeServiceImol实现类:
BeforAdvice增强类:
Application-statemenr.xml文件:
测试:
结果: