Parameterized Singleton Patterns

The link here lists ([http://www.yoda.arachsys.com/csharp/singleton.html†[1]) some singleton patterns in C #. The article also describes the obvious that a singleton is not designed to accept parameters that "because otherwise a second request for an instance, but with a different parameter, can be problematic." This means that any parameters necessary for the class to work must be called as a property.

I'm curious to know if there are any parameterized singleton design patterns. Acceptance of values ​​as properties does not impose anything on the consumer.

+5
source share
2 answers

, Abstract Factory ( ), / , , singleton .

Factory , , , , , , .

+3

, , , .

singleton .

singleton, .

. ( ) , , .

, factory. .

N , .

Inversion of Controls.

, - , . container.Get( ). DI . singleton - .

+1

All Articles