How to implement singleton without using static/global variable? Possible?
How to implement singleton without using static/globa开发者_C百科l variable? Possible?
This is an interview question...
Dependency injection is one possibility. Since your question is not specific to any programming language, I am not posting framework specific syntax (such as Ninject)
Store the singleton in a file.
No. You need a place to store the singleton.
精彩评论