Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOP、ASM、AspectJ、CGLIB之间的联系 #26

Closed
bfchengnuo opened this issue Feb 18, 2019 · 0 comments
Closed

AOP、ASM、AspectJ、CGLIB之间的联系 #26

bfchengnuo opened this issue Feb 18, 2019 · 0 comments

Comments

@bfchengnuo
Copy link
Owner

先简单写写,大概可能也就这样了,这些概念不打算再深入。

AOP:面向切面,这个基本已经很了解了,博客里很早之前也写了,学 Spring 的时候这个肯定都搞过。

ASM:简单来说它是一个非常厉害的修改字节码的工具,注意是字节码也就是编译后的那个文件,修改后可以直接 load 到 JVM 运行,所以你可以在不修改代码、不重新编译的情况下来修改执行逻辑。

AspectJ:Eclipse 下的非常有名的一个为 Java 编程语言创建的面向切面的编程扩展,易用性强,定义了一系列的 AOP 名词,这些被 Spring 采用了,提供了类似的注解;只不过 AspectJ 本身是静态代理,也就是编译时织入的,跟 Spring 的动态方式不太一样。

CGLIB:这个也比较熟悉了,为了解决 JDK 动态代理不支持非接口的问题,使用动态修改字节码使用继承来解决非接口的 AOP 问题,内部使用的也是 ASM。

@bfchengnuo bfchengnuo changed the title AOP、ASM、AspectJ、CGLIB联系?? AOP、ASM、AspectJ、CGLIB之间的联系 May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant