Andorid -->AOP相关概念
一:相关资料
- l http://www.eclipse.org/aspectj/ <=AspectJ官方网站
- | http://www.eclipse.org/aspectj/doc/released/runtime-api/index.html <=AspectJ类库参考文档,内容非常少
- l http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/index.html <=@AspectJ文档,以后我们用Annotation的方式最多
- l http://fernandocejas.com/2014/08/03/aspect-oriented-programming-in-android <==@ 编程教程英文资料
- l http://blog.csdn.net/innost/article/details/49387395 <== @ csdn上一篇不错文章链接深入理解Android之AOP
- l https://github.com/android10/Android-AOPExample <==@简单Demo
- l android -->aop <==@环境搭建。
- l android -->注解 <==@编写自己的注解类。
- l andorid -->log <==@日志模块实现。
- l android -->aop log <===@统计模块代码实现。
- |android -->aop <===@注解混淆配置
二:概念介绍
- Joinpoint:<====@在系统运行之前,AOP的功能模块都需要织入到OOP的功能模块中。所以,要进行这种织入过程,我们 需要知道在系统的那些执行点上进行织入操作。这些将要在其上进行织入操作的系统执行点就称之为Joinpoint.
- Pointcut: <====@Pointcut指定系统中符合条件的一组Joinpoint。代表的是Joinpoint的表达方式。将横切逻辑织入当前系统的过程中,需要参照Pointcut规定的Joinpoint信息,才可以知道应该往系统的哪些Joinpoint上织入横切逻辑。
- Advice:<====@是单一横切关注点逻辑的载体,代表将会织入到Joinpoint处的横切逻辑,按照Advice在Joinpoint处执行时机的差异或者完成功能的不同,Advice可分成以下具体形式:Before Advice,After Advice(Afterreturning Advice、AfterThrowing Advice、AfterFinally Advice),Around Advice,Introduction。
-
Aspect:<====@是对体统中的横切关注点逻辑进行模块化封装的AOP概念实体。Aspect可以包含多个Pointcut以及相应的Advice定义。
-
织入: <====@完成横切关注点逻辑(以Aspect模块化的横切关注点)到OOP系统的过程。