I am doing a mock exam where I didn't quite understand one of the answers which lacked an explanation of why it was correct.
(Edited from here downward by kriegaex, adding the question from the below comment and some formatting and rephrasing in order to make the text a bit more coherent and readable.)
- Question: "Which below statement is true about Spring's proxy feature?"
- Answer: "There is a type of Spring proxy that can replace the object being returned by the method."
I understand that Spring AOP can use two types of proxies:
- JDK dynamic proxies
- CGLIB proxies
In my understanding these are the two type of proxies that are heavily used in Spring. For example when using @Transactional
or when creating aspects (@Aspect
).
What I understand of the answer given is that they are pointing at the @Around
aspect. However, I don't understand why they call it a "type of Spring proxy". Is an aspect a proxy? Thus, is my understanding of an aspect making use of the JDK or the CGLIB proxies incorrect?