It is implemented as a singleton class.
它是一个单实例类。
I suppose I'll just stay a singleton all my life!
我觉得我会一辈子保持单身。
This class is a singleton and cannot be created directly.
这个类是唯一的,不能直接创建。
He was a singleton for a few years before he met his wife.
在遇到他妻子之前,他也单身了好多年。
First, XML is a Scala object. That is, it is a singleton object.
首先,XML是一个Scala对象,即它是一个单例(singleton)对象。
So, it also can be used to create a singleton instance of a class.
因此,它也可以用来创建一个类的单身实例。
We don't really need more than one instance here, so a singleton is fine.
我们实际上并不需要更多的实例,所以单体模式也不错。
One common use is for storing a singleton of a type that is not thread-safe.
一种常见用法是用于存储非线程安全类型的单例。
The Manager object is a singleton and is needed to create all other objects.
Manager是一个单实例对象,需要它来创建所有其他对象。
All calls to a singleton object are handled by one instance of that object.
所有对单一物件的呼叫都是由该物件的一个执行个体所处理。
Make it a singleton and all other objects can easily find and communicate with it.
让它单独和所有其他对象可以很容易地找到与它沟通。
The API is straightforward: You call a singleton method and get back a connection object.
API很直观:您调用单个方法,并返回一个连接对象。
In that case, a new singleton object will be created.
在这种情况下,一个新的单例对象会被创建。
This is a standard PHP singleton pattern.
这是一个标准的php单元素模式。
For example, take a look at the connection pool singleton in Listing 1.
例如,看一下清单1内所示的这个连接池单例。
If we follow a straight singleton pattern for PoIdGenerator, this can be problematic.
如果我们使用PoIdGenerator的直接单一模式,可能会出现问题。
Now, when you add a new file to your project, "Singleton" should be an option.
现在,当你添加一个新的文件到项目中,“单身”应该是一种选择。
Singleton: one instance of a class or one value accessible globally in an application.
单例:保证一个类仅有一个实例,并提供一个访问它的全局访问点。
Singleton: one instance of a class or one value accessible globally in an application.
单例:保证一个类仅有一个实例,并提供一个访问它的全局访问点。
应用推荐