I've written a factory which is instantiated by the main application. I also have some threads that want to use that factory to create some DAO's. is there a way for the thread to access the factory without explicitly giving the thread a reference to it upon its creation?
Singletons and static creational methods both come to mind.
Both of those have drawbacks with flexibility and extensibility. You wanted to rule out "injecting" a factory into the classes that need them. Any particular reason? That gives a better dependency picture than the samples above and makes it easier to slip in alternative factories if need be.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi