Is there a realisation of a Singleton-like pattern which allows to create more than one instance (e.g 5 instances and no more). I guess it will be called Multiton Pattern.
Thanks in advance
Is there a realisation of a Singleton-like pattern which allows to create more than
Share
It sounds like you’re trying to perform some kind of object pooling?
If so, here’s a solution I found with a quick Google search. http://www.codeproject.com/KB/cs/DotNetObjectPool.aspx
If I’m wrong, and you have a legit reason for limiting the number of instances, here’s another SO question addressing this very pattern: Limit instances creation of a class?