As with most technologies, AOP comes with its own specific set of concepts and terms. It is important that you understand what these terms mean before we explain how to use AOP in an application. The following list explains the core concepts of AOP:

  • Joinpoints: A joinpoint is a well-defined point during the execution of your application. Typical examples of joinpoints include a call to a method, the Method Invocation itself, class initialization, and object instantiation. Joinpoints are a core concept of AOP and define the points in your application at which you can insert additional logic using AOP.
  • Advice: The code that is executed at a particular joinpoint is the advice. There are many different types of advice, such as before, which executes before the joinpoint, and after, which executes after it. In OOP, an advice comes in the form of a method within a class.
  • Pointcuts: A pointcut is a collection of joinpoints that you use to define when advice should be executed. By creating pointcuts, you gain fine-grained control over how you apply advice to the componets in your application. As mentioned previously, a typical joinpoint is a Method Invocation. A typical pointcut is the collection of all Method Invocation in a particular class. Often you can compose pointcuts in complex relationships to further constrain when advice is executed.
  • Aspects: An aspect is the combination of advice and pointcuts. This combination results in a definition of the logic that should be included in the application and where it should execute.
  • Weaving: This is the process of actually inserting aspects into the application code at the appropriate point. For compile-time AOP solutions, this is, unsurprisingly, done at compile time, usually as an extra step in the build process. Likewise, for runtime AOP solutions, the weaving process is executed dynamically at runtime. AspectJ supports another weaving mechanism called load-time weaving(LTW), in which it intercepts the underlying JVM class loader and provides weaving to the bytecode when it is being loaded by the class loader.
  • Target: An object whose execution flow is modified by some AOP process is referred to as the target object. Often you see the target object referred to as the advised object.
  • Introduction: This is the process by which you can modify the structure of an object by introducing additional methods or fields to it. You can use introduction to make any object implement a specific interface without needing the object's class to implement that interface explicitly.

AOP Concepts的更多相关文章

  1. Spring Core Programming(Spring核心编程) - AOP Concepts(AOP基本概念)

    1. What is aspect-oriented programming?(什么是面向切面编程?) Aspects help to modularize cross-cutting concern ...

  2. Spring AOP简介

    AOP简述 AOP的概念早在上个世纪九十年代初就已经出现了,当时的研究人员通过对面向对象思想局限性的分析研究出了一种新的编程思想来帮助开发者减少代码重复提高开发效率,那就是AOP,Aspect-Ori ...

  3. The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect.

    Spring Framework Overview https://www.tutorialspoint.com/spring/spring_overview.htm Aspect Oriented ...

  4. Domain Driven Design and Development In Practice--转载

    原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about ma ...

  5. spring Transaction Management --官方

    原文链接:http://docs.spring.io/spring/docs/current/spring-framework-reference/html/transaction.html 12.  ...

  6. Spring之 Aspect Oriented Programming with Spring

    1. Concepts Aspect-Oriented Programming (AOP) complements OOP by providing another way of thinking a ...

  7. Spring框架文档与API(4.3.6版本)

    http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ Table of Contents I ...

  8. AOP programming paradiag

    AOP https://en.wikipedia.org/wiki/Aspect-oriented_programming Typically, an aspect is scattered or t ...

  9. Chapter 4: Spring and AOP:Spring's AOP Framework -- draft

    Spring's AOP Framework Let's begin by looking at Spring's own AOP framework - a proxy-based framewor ...

随机推荐

  1. Java多态性举例说明

    Java多态性的概念也可以被说成“一个接口,多个方法”. (一)相关类 class A ...{ public String show(D obj)...{ return ("A and D ...

  2. Upgrade to Python 2.7.9 on CentOS5.5

    1. Install python2.7 #cd /tmp #wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz --no-ch ...

  3. Oracle 存储过程(2)

    http://www.cnblogs.com/chinafine/archive/2010/07/12/1776102.html http://blog.itpub.net/29485627/view ...

  4. Android Service生命周期及用法

    Service概念及用途:Android中的服务,它与Activity不同,它是不能与用户交互的,不能自己启动的,运行在后台的程序,如果我们退出应用时,Service进程并没有结束,它仍然在后台运行, ...

  5. expdp 备份数据库-附带报错信息

    操作系统层面创建目录 [root@Oracle11g ~]# mkdir -p /home/oracle/db_back/ 修改目录的所属用户.所属组 [root@Oracle11g ~]# chow ...

  6. IIS7、IIS6 web.config注册HttpModule

    IIS6注册HttpModule <system.web>     <httpModules>       <add name="..." type= ...

  7. hibernate_validator_09

    创建自己的约束规则 尽管Bean Validation API定义了一大堆标准的约束条件, 但是肯定还是有这些约束不能满足我们需求的时候, 在这种情况下, 你可以根据你的特定的校验需求来创建自己的约束 ...

  8. shell每日发邮件

    LOGFILE="$fank/"`date +"%Y%m%d"`"data"#每日文件 from="abc@123.com&quo ...

  9. (转载)最实用的清除浮动代码 css的文字过长裁剪后面跟着省略号

    css: .clearfloat:after{display:block;clear:both;content:"";visibility:hidden;} .clearfloat ...

  10. localstorage || globalStorage || userData

    globalStorage 这个也是html5中提出来,在浏览器关闭以后,使用globalStorage存储的信息仍能够保留下来,并且存储容量比IE的userdata大得多,一个域下面是5120k.和 ...