As we all know, AOP is provided by CGLIB / JDK Proxy in Spring. Does the weaving happen at runtime, or is the bytecode modified at compiletime to include the advice?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to Spring documentation, it is done at runtime:
Since Java’s dynamic proxies work only with interfaces:
The Spring documentation has a good explanation of how the proxying works.
Compare this to AspectJ, where the weaving happens on compile, which interestingly enough can happen at various points:
In AspectJ: