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 ...
随机推荐
- 学习《Spring 3.x 企业应用开发实战》Day-1
Day-1 记录自己学习spring的笔记 提要:根据<Spring 3.x 企业应用开发实战>开头一个用户登录的例子,按照上面敲的. 1.项目分层
- jQueryUI 日期控件
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Inse ...
- Mysql 中和同to_char 一样用法的函数
STR_TO_DATE() $sql = " SELECT "; $sql .= " m_img,m_content,STR_TO_DATE(m_time,\" ...
- Phonegap 极光推送api 服务器端推送代码
.net 版本 极光推送 后台接口 HttpWebResponseUtility类 using System; using System.Collections.Generic; using Syst ...
- IDisposable接口详解
转载:http://www.cnblogs.com/davyli/archive/2010/09/13/1825042.html 正确实现 IDisposable .NET中用于释放对象资源的接口是I ...
- 运行phpize时出现:Cannot find autoconf. Please check your autoconf installation
运行/usr/local/webserver/php/bin/phpize时出现:Configuring for:PHP Api Version: 20041225Zend Module Api No ...
- EBS与FMW集成工作流管理器的检查
工作流管理器的检查点(DB层面): --1:数据库job aq参数设置,建议设置job_queue_processes>=10 select p.NAME,p.DESCRIPTION,p.VAL ...
- cocos2d-x 实现沙子特效
效果图. 说明. 标题取的不好, 原因是我也不知道这效果应该叫什么. 大概效果是这样的, 随着鼠标按下并且移动, 所到之处所有磁铁都将扩散. 就好比鼠标是一个圆形区域去排挤在场的磁铁. 话不多说, 直 ...
- 【COGS 56】质数取石子
[问题描述] DD 和 MM 正在玩取石子游戏.他们的游戏规则是这样的:桌上有若干石子,DD 先取,轮流取,每次必须取质数个.如果某一时刻某一方无法从桌上的石子中取质数个,比如说剩下 0 个或 1 个 ...
- nodejs新手教程中upload file的问题
可参见: http://cnodejs.org/topic/50234890f767cc9a51f88481 request.setEncoding("utf8");应注释掉.