开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜