felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Dubrov <wfr...@gmail.com>
Subject Re: Can the thread context classloader issue be solved at all?
Date Wed, 19 Jan 2011 07:34:19 GMT
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!

Ivan S. Dubrov

To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

View raw message