cglib [sourceforge.net], a library that lets you do metaclass programming efficiently in Java; it’s similar to java.lang.reflect.Proxy, but more flexible and compiled to bytecode. Cglib is commonly used to create decorators — for example, Hibernate uses it to generate proxies, to transparently track whether persistent objects have changed in memory and must be re-saved to the database — but there are other uses, such as mimicking the mixin pattern. [via ask slashdot]
http://asm.objectweb.org/ java bytecode manipulation framework. It can be used to dynamically generate stub classes or other proxy classes, directly in binary form, or to dynamically modify classes at load time,
ASM Toolkit for Bytecode Manipulation
An Experience: "Hibernate 3.0 relies on CGLIB 2.x, which relies on ASM 1.x, which is API-incompatible with ASM 2.x, so my app experiences an unrecoverable error during context initialization."
How IBatis uses CGLIB: "If you want to enable CGLIB 2.0 bytecode enhancement to improve lazy loading and reflection performance."
No comments yet.