AOP Concepts
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的更多相关文章
- Spring Core Programming(Spring核心编程) - AOP Concepts(AOP基本概念)
1. What is aspect-oriented programming?(什么是面向切面编程?) Aspects help to modularize cross-cutting concern ...
- Spring AOP简介
AOP简述 AOP的概念早在上个世纪九十年代初就已经出现了,当时的研究人员通过对面向对象思想局限性的分析研究出了一种新的编程思想来帮助开发者减少代码重复提高开发效率,那就是AOP,Aspect-Ori ...
- 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 ...
- Domain Driven Design and Development In Practice--转载
原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about ma ...
- spring Transaction Management --官方
原文链接:http://docs.spring.io/spring/docs/current/spring-framework-reference/html/transaction.html 12. ...
- Spring之 Aspect Oriented Programming with Spring
1. Concepts Aspect-Oriented Programming (AOP) complements OOP by providing another way of thinking a ...
- Spring框架文档与API(4.3.6版本)
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ Table of Contents I ...
- AOP programming paradiag
AOP https://en.wikipedia.org/wiki/Aspect-oriented_programming Typically, an aspect is scattered or t ...
- 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 ...
随机推荐
- 从 ReactiveCocoa 中能学到什么?不用此库也能学以致用
从知道ReactiveCocoa开始就发现对这个库有不同的声音,上次参加<T>技术沙龙时唐巧对在项目中已全面使用FRP的代码家提出为什么这种编程模型出现了这么长时间怎么像ReactiveC ...
- Android带参数链接请求服务器
public void taste() { //设默认值 SharedPreferences.Editor editor = this.getSharedPreferences("setti ...
- poj 1780 code(欧拉路)
/* 对于n为密码想要序列最短 那么 1234 2345 这两个一定挨着 就是说 前一个的后n-1位是后一个的前n-1位 假设n==3 我们用0-99作为点的编号建图 然后每个点连出去10条边 两个相 ...
- Android界面刷新方法
Android提供了Invalidate方法实现界面刷新,但是Invalidate不能直接在线程中调用,因为他是违背了单线程模型:Android UI操作并不是线程安全的,并且这些操作必须在UI线程中 ...
- 不同浏览器创建XMLHttpRequest对象
function getXHR() { if (XMLHttpRequest) { return new XMLHttpRequest(); } else { return new ActiveXOb ...
- 【转】 自定义iOS7导航栏背景,标题和返回按钮文字颜色
原文:http://blog.csdn.net/mad1989/article/details/41516743 UIBarButtonItem,navigationItem,backBarButto ...
- Linux下面/usr/local和opt目录
1./opt This directory is reserved for all the software and add-on packages that are not part of the ...
- 03_RHEL7.1去掉注册提示
# rpm –qa|grep subscription-manager 出现类似下面的代码: subscription-manager-firstboot-1.13.22-1.el7.x86_64 s ...
- Python学习笔记:07异常
异常 Python用异常对象(Exception Object)来表示异常情况,当异常未被捕获时,就会产生回溯(Traceback) 异常分类 內建异常类:Exception,AttributeErr ...
- ubuntu 的远程桌面
好久没有弄ubuntu 丢人的啊,先安装了个服务器版,发现好多命令都忘记了,命令行下根本搞不懂 又安装了个桌面版...但是服务器远程么,putty还是搞的头大,又乱码,有各种文件传输. 还好记得以前用 ...