学习中的疑惑
Topic sourceUserService us = new UserService(); // 这是你的UserService
UserService proxy = new UserService$$EnhancerBySpringCGLIB(us); // 这是Proxy
proxy内部调super,这个super不是us实例
你仔细复习proxy模式,proxy内部持有target,他自己的super毫无意义
- 1
UserService us = new UserService(); // 这是你的UserService
UserService proxy = new UserService$$EnhancerBySpringCGLIB(us); // 这是Proxy
proxy内部调super,这个super不是us实例
你仔细复习proxy模式,proxy内部持有target,他自己的super毫无意义
蛇皮_-
对于这个类:
它继承了UserService ,因此它想调用 UserService 的方法时,完全可以用:
这种形式啊,为什么要存原始的实例再用:
请老师解答一下
最近碰到了 aop 自调用时不执行切面逻辑的问题,如果内部实现是 super 种的话,感觉切面就不会失效了