Parameterized Singleton problem
We have a lot of Object Managers in our existing code which manage objects based on parameters to a static factory method. For eg.
Object obj1 = ObjectManager.getInstance("param1");
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.
Object obj2 = ObjectManager.getInstance("param2");
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.