|
I haven't looked at Jandex but knowing the authors I don't think it would be easy to find a good argument to hide its API. Seems you all committed to use it, then I'd say "so be it": let's embrace it, but then why encapsulate it? Encapsulation is important to shield the Hibernate user to know anything about Jandex but I don't think it's something to pursue for our own comfort.
Still I'm neutral about this, as also there is no evidence to be too concerned on the memory weight of the metamodel: metamodel is allocated once, made immutable and then reused right? The current problems we're fixing are all in the area of objects which are allocated at runtime to perform DB operations: what we allocate just once for SessionFactory is less of a concern (assuming we don't completely screw up but I trust you both on that).
I'd rather focus on making sure that this API that you would use to duplicate Jandex functionality won't be slowing us down at runtime: if it's a simple wrapper with delegation it's going to be fine, but then again why would you make it?
|