Stage 3 2.Spring_08. Oriented Programming AOP_4 spring XML-based configuration steps AOP-

New bean.xml files Resources


xmlns: AOP

Configure IOC

aop




Notification class is the logger. id Configure a notification log is logAdvice

Combing process

First of all we have in this a Service that it needs to be enhanced. It wants to performing any of the methods which have a log

and then we will prepare a day out of class. This log class prinLog the inside a logging method may

configure the notification log. And indicate which has a printLog method. It will be executed before the execution of the method Service

now there is a big problem. Our pre-notification class and Serice not have any relationship

pointCut





Go over ideas

Cut point expression clearly said, prinlog To saveAccount enhanced




 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11355001.html