Java動態代理 CGLib
CGLib (Code Generation Library) 是一個強大的,高性能,高質量的Code生成類庫。它可以在運行期擴展Java類與實現Java接口。Hibernate用它來實現PO字節碼的動態生成。CGLib 比 Java 的 java.lang.reflect.Proxy 類更強的在于它不僅可以接管接口類的方法,還可以接管普通類的方法。
以下是cglib所使用和使用cglib的開源項目:
"The
Byte Code Engineering Library (formerly known as JavaClass) is intended to give users a convenient possibility to analyze, create, and manipulate (binary) Java class files (those ending with .class)." Used by cglib for Class file format manipulation.
"
XORM is an extensible object-relational mapping layer for Java applications. It provides interface-based persistence to RDBMSs while allowing developers to focus on the object model, not the physical layer." Uses cglib to generate persistent classes.
"
Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java. Hibernate lets you develop persistent objects following common Java idiom, including association, inheritance, polymorphism, composition and the Java collections framework." Uses cglib to generate proxies for persistent classes.
"
The Java Class File Editor allows you to read / modify java .class files, either on disk or while loading classes at runtime. The project grew out of the Generic Delegator, which creates new classes on the fly, allowing you to dynamically implement a group of interfaces by forwarding them to a shim" Both cglib and JCFE provide dynamic proxy implementation
"
Voruta reduces JDBC code in application, it makes code more readable and safe, SQL procedures and queries are mapped to JAVA methods using custom javadoc tags and dynamic code generation at runtime. It needs no custom build tools or external files" Uses cglib to generate method implementations.
"
Nanning Aspects is a simple yet scaleable aspect-oriented framework for Java."
"
Spring is a J2EE application framework based on code published in Expert One-on-One J2EE Design and Development http://www.wrox.com/books/1861007841.htm by Rod Johnson."
"
The iBATIS Database Layer takes a different approach to solving the Object Relational mapping problem --it avoids it altogether!"
"
ASM is a Java bytecode manipulation framework. It offers similar functionalities as BCEL or SERP, but is much more smaller and faster than these tools."
"
Proxool is a Java connection pool."
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!