Today I was wondering why frameworks like `Hibernate use reflection instead of code generation (for example using libraries like BCEL or ASM) during compilation/application startup.
Is it because of historical reasons (when Hibernate
was being written there was no such library available that would allow byte code generation on the fly) and now everybody uses this approach?
I would assume that the approach with generated code would be faster then the one that uses reflection.
Right, Hibernate
could likely benefit from code generation, though the profit might not be as big as you suppose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With