On 01/19/2011 03:06 AM, Guillaume Nodet wrote:
A cleaner API would be to actually pass a classloader directly (JaxbContext does that for example IIRC), but it's basically the same: the caller needs to build / find the classloader, so it does not really change anything.
It changes it in the way that this approach makes dependencies more explicit. If library needs to load some resources it does not know in advance, it is perfectly fine for it to ask for classloader directly, like JAXBContext does. Also, the explicit approach allows to pass classloader to the library just once, during instance creation (like instantiating JAXBContext).
The whole TCCL thing just leads to the bad design (increased coupling), just like other "static" state which is not bound to the instances. Explicit references passing eased by dependency injection -- that is the proper approach!
-- WBR, Ivan S. Dubrov --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

