Singleton
- 单例模式的类只提供私有的构造函数
- 类定义中含有一个该类的静态私有对象
- 该类提供了一个静态的公有的函数用于创建或获取它本身的静态私有对象
|
|
Reference
参考资料
- https://github.com/senghoo/golang-design-pattern/blob/master/03_singleton/singleton.go
- http://design-patterns.readthedocs.io/zh_CN/latest/creational_patterns/singleton.html#id19
- https://github.com/senghoo/golang-design-pattern
- https://github.com/faif/python-patterns
- https://sourcemaking.com/design_patterns
Linked Mentions
-
No backlinks found.