Advice

(好多中文书籍翻译为:增强处理,比如前向增强、后向增强等)
描述了Aspect类执行的具体动作。the job of an aspect.
定义了如下两个方面:
  1. what:即Aspect类具体的功能;
  2. when:功能作用的时间点;
在spring中,when包括5个:



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.
程序中可以有很多个join point,这些连接点可以是方法调用异常抛出、以及域修改等。这些都是在程序运行时的某个点。

Pointcuts

pointcut定义了advice需要在哪些join points进行织入。pointcuts define which join points get advised.
可以简单理解为若干join point的集合,advice会在这些join points进行织入。
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。
允许在已经存在的类中,添加新的方法和属性;

WEAVING

Weaving is the process of applying aspects to a target object to create a new proxied object。
主要有3种织入方式:
  1. Compile time:AspectJ使用这种方式;
  2. Class load time:AspectJ使用这种方式;
  3. Runtime:Spring支持的方式;


Spring对AOP的支持


spring AOP基于动态的代理实现,局限于对方法的拦截

  • SPRING ADVICE IS WRITTEN IN JAVA :所有的advice都使用Java编写,pointcut可使用XML或annotation;
  • SPRING ADVISES OBJECTS AT RUNTIME:在运行时织入advice;
  • SPRING ONLY SUPPORTS METHOD JOIN POINTS:仅支持方法的join point;


【Spring-AOP-1】AOP相关概念的更多相关文章

  1. [原创]java WEB学习笔记105:Spring学习---AOP介绍,相关概念,使用AOP,利用 方法签名 编写 AspectJ 切入点表达式

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  2. Spring框架(4)---AOP讲解铺垫

    AOP讲解铺垫      不得不说,刚开始去理解这个Aop是有点难理解的,主要还是新的概念比较多,对于初学者一下子不一定马上能够快速吸收,所以我先对什么事Aop做一个解释: 首先说明:本文不是自己所写 ...

  3. 学习 Spring (十二) AOP 基本概念及特点

    Spring入门篇 学习笔记 AOP: Aspect Oriented Programming, 通过预编译方式和运行期动态代理实现程序功能的统一维护的一种技术 主要功能是:日志记录.性能统计.安全控 ...

  4. Spring笔记:AOP基础

    Spring笔记:AOP基础 AOP 引入AOP 面向对象的开发过程中,我们对软件开发进行抽象.分割成各个模块或对象.例如,我们对API抽象成三个模块,Controller.Service.Comma ...

  5. 如何实现一个简易版的 Spring - 如何实现 AOP(上)

    前言 本文是「如何实现一个简易版的 Spring 系列」的第五篇,在之前介绍了 Spring 中的核心技术之一 IoC,从这篇开始我们再来看看 Spring 的另一个重要的技术--AOP.用过 Spr ...

  6. Spring 3.0 AOP (一)AOP 术语

    关于AOP.之前我已写过一个系列的随笔: <自己实现简单的AOP>,它的关注点在于实现.实现语言是C#,实现方式为 自定义实现 RealProxy 抽象类.重写Invoke方法,以便进行方 ...

  7. Spring系列之AOP实现的两种方式

    AOP常用的实现方式有两种,一种是采用声明的方式来实现(基于XML),一种是采用注解的方式来实现(基于AspectJ). 首先复习下AOP中一些比较重要的概念: Joinpoint(连接点):程序执行 ...

  8. Spring学习之AOP总结帖

    AOP(面向方面编程),也可称为面向切面编程,是一种编程范式,提供从另一个角度来考虑程序结构从而完善面向对象编程(OOP). 在进行 OOP 开发时,都是基于对组件(比如类)进行开发,然后对组件进行组 ...

  9. spring注解实现AOP

    项目结构图

  10. Spring AOP Schema aop:config、tx:advice

    Spring AOP Schema  aop:config.tx:advice 一.      利用aop:config标签实现AOP 首先看个例子,如下 接口代码: package com.lei. ...

随机推荐

  1. 刻通云KeyTone Cloud测试

    注:本文转自陈沙克的博客,原文见http://www.chenshake.com/carved-through-the-keytone-cloud-cloud-testing/ 一直都很希望有更多的O ...

  2. [转载] 已知strcpy的函数原型:char *strcpy(char *strDest, const char *strSrc),编写函数 strcpy(C++版)

    已知strcpy的函数原型:char *strcpy(char *strDest, const char *strSrc)其中strDest 是目的字符串,strSrc 是源字符串.不调用C++/C ...

  3. Mybatis学习 —— 包括所有 mybatis官网

    http://www.mybatis.org/mybatis-3/zh/configuration.html#typeAliases

  4. C专家编程学习 1

    1.C语言的基本数据类型直接与底层硬件相对应. 2#define 是可能出现问题 1 2 3 4 5 #define a(y) a_ex(y) a(x)被扩展为 a_ex(x)   #define a ...

  5. URAL 1218 Episode N-th: The Jedi Tournament(强连通分量)(缩点)

    Episode N-th: The Jedi Tournament Time limit: 1.0 secondMemory limit: 64 MB Decided several Jedi Kni ...

  6. 深入理解html5系列-文本标签

    转:http://blog.csdn.net/lihui130135/article/details/45150501 文章简介:       关于html5相信大家早已经耳熟能详,但是他真正的意义在 ...

  7. sellect、poll、epoll

    http://www.cnblogs.com/alex3714/p/4372426.html select select最早于1983年出现在4.2BSD中,它通过一个select()系统调用来监视多 ...

  8. HttpWebRequest's Timeout and ReadWriteTimeout — What do these mean for the underlying TCP connection?

    http://stackoverflow.com/questions/7250983/httpwebrequests-timeout-and-readwritetimeout-what-do-thes ...

  9. java .net compartion

    1, http://www-01.ibm.com/software/smb/na/J2EE_vs_NET_History_and_Comparison.pdf http://stackoverflow ...

  10. Linux体系结构(二): Linux系统层次

    前一节内容大概介绍了一下Linux的历史由来,各大Linux发行厂商都是基于GNU项目下的所有开源软件,来构建各自己的Linux发行版本,一个完整的Linux发行版本大概可以分为以下四个层次结构:   ...