當(dāng)前位置:
首頁(yè) >
前端技术
> javascript
>内容正文
javascript
【Spring-AOP-1】AOP相关概念
生活随笔
收集整理的這篇文章主要介紹了
【Spring-AOP-1】AOP相关概念
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Advice
(好多中文書(shū)籍翻譯為:增強(qiáng)處理,比如前向增強(qiáng)、后向增強(qiáng)等)描述了Aspect類執(zhí)行的具體動(dòng)作。the job of an aspect.定義了如下兩個(gè)方面:Join Points
A join point is a point in the execution of the application where an aspect can be plugged in.This point could?be a method being called, an exception being thrown, or even a field being modified.程序中可以有很多個(gè)join point,這些連接點(diǎn)可以是方法調(diào)用、異常拋出、以及域修改等。這些都是在程序運(yùn)行時(shí)的某個(gè)點(diǎn)。
Pointcuts
pointcut定義了advice需要在哪些join points進(jìn)行織入。pointcuts define which join points get advised.可以簡(jiǎn)單理解為若干join point的集合,advice會(huì)在這些join points進(jìn)行織入。If advice defines the what and when of aspects, then pointcuts define the where。
A?pointcut definition matches one or more join points at which advice should be woven.
Aspect
An aspect is the merger of advice and pointcuts。Aspect是advice和pointcuts的組合。
Introduction
An introduction allows you to add new methods or attributes to existing classes。允許在已經(jīng)存在的類中,添加新的方法和屬性;
WEAVING
Weaving is the process of applying aspects to a target object to create a new proxied?object。主要有3種織入方式:Spring對(duì)AOP的支持
spring AOP基于動(dòng)態(tài)的代理實(shí)現(xiàn),局限于對(duì)方法的攔截。
- SPRING ADVICE IS WRITTEN IN JAVA :所有的advice都使用Java編寫(xiě),pointcut可使用XML或annotation;
- SPRING ADVISES OBJECTS AT RUNTIME:在運(yùn)行時(shí)織入advice;
- SPRING ONLY SUPPORTS METHOD JOIN POINTS:僅支持方法的join point;
來(lái)自為知筆記(Wiz)
轉(zhuǎn)載于:https://www.cnblogs.com/ssslinppp/p/5580979.html
總結(jié)
以上是生活随笔為你收集整理的【Spring-AOP-1】AOP相关概念的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: offsetTop,offsetHeig
- 下一篇: 存储过程传入参数与表字段名相同时产生的问