zoukankan      html  css  js  c++  java
  • [Spring] Aspect Oriented Programming with Spring | AOP | 切面 | 切点

      使用Spring面向切面编程

    1.介绍

    AOP是OOP的补充,提供了另一种关于程序结构的思路.

    OOP的模块化的关键单位是 类 .

    AOP的则是aspect切面.

    AOP 将程序的逻辑分成独立的块(叫做concern 重心,关注点).

    AOP是用来增加跨切重心(cross-cutting concerns)的模块化的.

    A cross-cutting concern 是一个可以影响整个程序的concern ,应该尽可能地在代码的某个位置中心化.

    例如:事务管理,授权,登录,日志,安全等.

    2.为什么使用AOP

    提供pluggable方法来动态增加附加的concern:before,after 或者around 逻辑块.

     AOP的入口在xml文件中.

    3. 在哪里使用AOP

    在以下场景:

    • to provide declarative enterprise services such as declarative transaction management.
    • It allows users to implement custom aspects.

    4.AOP概念和术语

    • Join point
    • Advice
    • Pointcut
    • Introduction
    • Target Object
    • Aspect
    • Interceptor
    • AOP Proxy
    • Weaving

    4.1 Join point

    Spring只提供方法执行接入点.

    4.2 Advice

    宛如智障,暗藏锋芒
  • 相关阅读:
    POJ1006(中国剩余定理)
    Ubuntu16.04安装jupiter
    OpenGL.tutorial06键盘和鼠标
    OpenGL.教程
    OpenGL.Qt532.cube
    Qt551.主窗体Margin
    Qt551.窗口滚动条
    Qt551.OpenGL.ZC简单例子
    Qt5OpenGL.顶点像素大小设置
    OpenGL.Tutorial03_Matrices_测试
  • 原文地址:https://www.cnblogs.com/zienzir/p/9113889.html
Copyright © 2011-2022 走看看