Skip to content

Commit

Permalink
spring aop
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspercliff committed Nov 14, 2024
1 parent 672ba5d commit 6ffbce3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 64 deletions.
63 changes: 0 additions & 63 deletions docs/java/framework/spring/core/aop/aop.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/java/framework/spring/core/aop/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Spring Framework 中的 AOP (Aspect-Oriented Programming,面向切面编程)
特别是将横切关注点(如日志、事务管理、安全等)从业务逻辑中分离出来。在 Spring 中,AOP 是通过代理模式实现的,
主要支持两种代理方式:基于JDK的动态代理和基于CGLIB的代理。

- oop 关注的是class
- aop关注的是aspect

### 核心概念
- **切面 (Aspect)**:包含切点和增强的组件
- **切点 (Pointcut)**:匹配连接点的断言,定义了切面应该在哪里被应用
Expand Down
3 changes: 2 additions & 1 deletion docs/java/framework/spring/core/aop/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# aop


- [基本知识](./basic.md)
- [基本知识](./basic.md)
- [spring](./spring.md)
19 changes: 19 additions & 0 deletions docs/java/framework/spring/core/aop/spring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# spring

> Using the AspectJ compiler and weaver enables use of the full AspectJ language and is discussed in Using AspectJ
> with Spring Applications.
![img.png](assets/img.png)

```xml
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-aop -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<version>3.3.5</version>
</dependency>
```

> To use @AspectJ aspects in a Spring configuration, you need to enable Spring support for configuring Spring AOP based on @AspectJ aspects and auto-proxying beans based on whether or not they are advised by those aspects. By auto-proxying, we mean that, if Spring determines that a bean is advised by one or more aspects, it automatically generates a proxy for that bean to intercept method invocations and ensures that advice is run as needed

0 comments on commit 6ffbce3

Please sign in to comment.