Parameterized Singleton problem
Hi,
We have a lot of Object Managers in our existing code which manage objects based on parameters to a static factory method. For eg.
Code:
Object obj1 = ObjectManager.getInstance("param1");
Code:
Object obj2 = ObjectManager.getInstance("param2");
The ObjectManager maintains one instance of the Object for each parameter value. In some cases the parameter is propagated to composite objects further down. The parameter value is decided at runtime.
We are planning to use Spring mainly for plug-n-play and I'm trying to figure out if Spring has anything out-of-the-box for this.
Would really appreciate if somebody could help me out on this one.
-Rajesh A