<aop:declare-parents types-matching="com.itany.service.IPersonService+" implement-interface="com.itany.service.IIntroduceService" default-impl="com.itany.service.impl.IIntroduceServiceImpl"/>
Description
- Configure under <aop:aspect> tab </aop:aspect>
- Types-matching: Match the target object expression that needs to be introduced into the interface;
- Implement-interface: Defines the interfaces that need to be introduced;
- Default-impl and Delegate-ref: Define the default implementation of the introduction interface, select one
Instance:
ApplicationContext act=new ClassPathXmlApplicationContext("beans.xml"); IIntroduceService introduceService = (IIntroduceService) act.getBean("personService"); introduceService.introduce("testintroduce"); ((IPersonService) introduceService).save();
In terms of understanding, this configuration realizes that the Introduceservice inherits the Personservice
Schema-based Introduction