单例模式可能是最常用的OOP设计模式之一了;它限制了一个类的对象实例数只能为1。
The singleton pattern is probably one of the most often used OOP design patterns; it restricts the number of object instances of a class to one.
单例模式是一种非常有用的设计模式,它允许你的类对外只提供一个实例,但是常犯的错误在于不止一个实例被创建。
The singleton is a useful design pattern for allowing only one instance of your class, but common mistakes can inadvertently allow more than one instance to be created.
单例模式是一种有用的控制类访问的途径,他能保证只有一个类实例存在。
Singletons are a useful way to control access to a class, making sure that only one instance can exist.
应用推荐