Nuwan Arambage wrote:Hi,
I was wondering why we need to add these jar file to class path.I have read articles however I'm still confused.I have three questions.
1. what are the functionality provided by the cglib to spring framework ?
2. what are the functionality provided by the asm to spring framework ?
3. Difference between cglib and asm ?
So Spring does a lot of Proxying. Most of the time this is done via DynamicProxy in the JDK at runtime creates a proxy based on the classes interfaces. If you class doesn't implement any interfaces it can't create a proxy. But CGLib can create on the fly proxies by extending the class it is going to proxy.
For ASM, this does byte code weaving/instrumentation at runtime.
So these instrumentation and proxies are to add functionality to your code without you having to write that code in your code. Either by decoration/proxy or byte code instrucmentation of that code into your class.
Hope that helps clear things up for you. You are not required to add the CGLib.jar, but it you want proxies on classes with no interfaces, then you need it.
Mark