|
Many former C or C++ programmers prefer generated-code solutions to
runtime reflection. This is usually justified by reference to the
performance red-herring. However, modern JVMs implement reflection
extremely efficiently and the overhead is minimal compared to the cost
of disk access or IPC. Developers from other traditions (eg. Smalltalk)
have always relied upon reflection to do things that C/C++ needs
code-generation for.
In the very latest versions of Hibernate,
"reflection" is optimised via the CGLIB runtime bytecode generation
library. This means that "reflected" property get / set calls no longer
carry the overhead of the Java reflection API and are actually just
normal method calls. This results in a (very) small performance gain.
|