建筑模式指导。 [英] Architectural Pattern Guidance.

查看:55
本文介绍了建筑模式指导。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

静态类是实现单例模式的方法这句话是正确的。

"Static Class is way of achieving singleton pattern" is this sentence correct.

推荐答案

没有。

除非你想要一个真正废话 Singleton 的实现。



有一个很好的解释< b>单身模式超过此处 [ ^ ]。



/ Fredrik
No.
Unless you want a really crap Singleton implementation.

There's a good explanation of the pitfalls with the Singleton pattern over here[^].

/Fredrik


参考这个链接当然你会得到一个明确的想法

http://stackoverflow.com/questions/46541/when-should-you-use-the-singleton-pattern-instead-of-a-static -class [ ^ ]



希望这有帮助
Refer this link of course you will get a clear idea
http://stackoverflow.com/questions/46541/when-should-you-use-the-singleton-pattern-instead-of-a-static-class[^]

Hope this helps


这篇关于建筑模式指导。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆