Hibernate actually uses CGLib, which is a relatively high-level API.
CGLib then does its lower level work with either BCEL or ASM (there is a
cglib 1.0 version for each). In general, there is not much of a case for
using BCEL instead of ASM (other than perhaps the fact that BCEL is
Apache licensed, and ASM is LGPL). ASM is _way_ smaller (something like
a tenth the size), a lot quicker, and produces a lot less objects while
it is working. I am not 100%, but I think the new version (2.0) of CGLib
may switch to using ASM exclusively.
Javassist is another code generation library, which I use internally at
work, and is also used in Tapestry and JBoss. It's quite nice, allowing
you to do the same kinds of code manipulations which CGLib does, but
also allowing you to insert new code with actual Java syntax...
Regards,
Colin
Alef Arendsen (JTeam) wrote:
> Hi all,
>
> I'm playing around with the source level metadata stuff and it looks
> really cool! I'm trying to implement some of our validation features
> using it and have successfully generated some classes using the
> MetaDataCompiler. However, I was wondering how BCEL affects the
> classes and if this is not going to bring us major problem when for
> instance serializing classes and stuff…
>
> Also, I once heard Hibernate uses asm and stuff, won't this bring any
> conflicts? I'm to use the functionality in our domain model…
>
> Might not be the right place to ask those kind of quesitons, but anyway…
>
> Thanx,
>
> Alef
>
> P.s. Joost, one of our people and the main backend guy here has moved
> to Spring completely by the way. He just said: hmmmm, it seems like
> those spring guys are actually doing a good job (it's really something
> if sceptic joost says something like that :-)
>
> ==
> JTeam B.V.
> Donker Curtiusstraat 7-412
> 1051 JL Amsterdam
> T: +31 20 486 20 36
> M: +31 6 24 11 1996
> F: +31 84 837 00 00
> E: al...@jt...
> W: _http://www.jteam.nl_
>
|