Spring AOP 高级特性深度解析
1. 引入功能介绍
引入(Introductions)是 Spring AOP 中极为强大的特性之一。通过引入,我们不仅能够扩展现有方法的功能,还能动态地为对象添加其所实现的接口集合。下面通过一个具体示例来详细了解引入功能。
首先,给出引入功能演示的 XML 配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<bean id="userService"
class="com.apress.prospring2.ch06.services.DefaultUserService"/>
<bean id="stockService"
超级会员免费看
订阅专栏 解锁全文
1060

被折叠的 条评论
为什么被折叠?



