lundi 19 décembre 2022

Is there an interface "ISingleton" I could use for creating a singleton class? [duplicate]

As mentioned in this other question, I'm looking for a way not to create always another instance of a class. I know this can be done, using a singleton.

As I've seen that quite some design patterns are handled by C# libraries, I believe this should be the case for the singleton design pattern, but I don't find an ISingleton interface, which I could implement.

Does anybody know in which library using which_library; I can find an ISingleton interface or should I create a singleton class from scratch?

Aucun commentaire:

Enregistrer un commentaire