Could anybody explain what is the bytecode libraries? For example, some Hibernate 3.5 book tells me that Hibernate uses javaassit or CGLib bytecode libraries. For what this libraries exists? Thank you.

有帮助吗?

解决方案

When you write a Java app, you have to compile with a compiler (e.g. javac) first. Some classfiles (*.class) are generated. There is the bytecode. The class file is a binary file that can be executed by a Java Virtual Machine.

You may want to read a classfile, modify a classfile (eg. for instrumentation) or create (generate) a completely new classfile. If you want to do this, a good library can make it easier. You don't have to care about the exact structure and many constants (e.g. opcodes).

CGLib homepage says that Hibernate "Uses cglib to generate proxies for persistent classes."

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top