PHP: Singleton vs Static Class
Possible Duplicate:
Difference between static class and singleton pattern?
Just wanted to know what exactly is the difference between a singleton and static class?
我认为这个问题已经在这里回答了:静态类和单例模式之间的区别?
In a singleton you can choose to initialize the variable at first call. Whereas a static variable starts to exists at the moment you include / call the file where the static variable is declared.
The big difference between a singleton and a bunch of static methods is that singletons can implement interfaces
.But static wont
Difference between static class and singleton pattern?
链接地址: http://www.djcxy.com/p/78816.html上一篇: 静态类和单例类之间的区别c#
下一篇: PHP:单例与静态类