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. Qt之QPropertyAnimation

    简述 QPropertyAnimation类定义了Qt的属性动画. QPropertyAnimation以Qt属性做差值,作为属性值存储在QVariants中,该类继承自QVariantAnimati ...

  2. java NIO-我们到底能走多远系列(39)

    献给各位: Satisfied MindRed Hayes and Jack RhodesHow many times have you heard someone say,"If I ha ...

  3. Codeforces Round #365 (Div. 2) A 水

    A. Mishka and Game time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  4. resin的基本操作

    1.什么是resin?     resin是CAUCHO公司的产品,是一个非常流行的支持servlets和jsp的引擎,速度非常快.Resin本身包含了一个支持HTTP/1.1的WEB服务器.虽然它可 ...

  5. JS的prototype的共享机制分析

    function Super(){ } Super.prototype.aaa=[1,2,3]; Super.prototype.bbb=1; function Sub(){ Super.call(t ...

  6. Codeforces Round #339 Div.2 C - Peter and Snow Blower

    Peter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. A ...

  7. matlab绘图+计算心得

    Matlab 常用于做一些计算实验和绘图,我主要用matlab来绘图件.Matlab 可以用GUI界面来完成绘图,但是既然能用鼠标完成的绘图,那么一定能用代码命令来完成绘图,个人比较喜欢用命令来完成m ...

  8. Threadpool dump

    Microsoft (R) Windows Debugger Version 10.0.10586.567 AMD64Copyright (c) Microsoft Corporation. All ...

  9. C函数之memcpy()函数用法

    函数原型 void *memcpy(void*dest, const void *src, size_t n); 功能 由src指向地址为起始地址的连续n个字节的数据复制到以destin指向地址为起始 ...

  10. Hive 安装配置记录

    http://yymmiinngg.iteye.com/blog/708230 export HADOOP_HOME_WARN_SUPPRESS=1 export JAVA_HOME=/home/ha ...