I want to create a "singleton-factory class" to retrieve my specialized objects. It is possible to create such a class and does it give me some performance surplus over a simpler solution like a static factory? Or are there any other solutions?
This class would be a key component of a data intensive application dealing with constant database access writes. Each specialized object would be called when the factory recognizes that it is needed to write a row in a table with a special pattern.
I'm not a performance expert but would like to tune the solution to be memory light, there's not a need for more that 1 factory across multiple threads dealing with specialized objects and I would like to implement some caching (to retrieve already created Specialized instances).
Solutions?