Authors: Paul Hammant, Jörg Schaible
Yes.
You should perhaps code multiple constructors for a component:
class MyComp { private ThreadPool theThreadPool; public MyComp(ThreadPool threadpool) { theThreadPool = threadpool; } public MyComp() { theThreadPool = new DefaultThreadPool(); } // other methods. }
See additional comments at How does PicoContainer decide what constructor to use.