• 因为根据设计线程安全的,创建之后可以把它存在一个公共静态最终变量中,或者包装实例模式以供以后访问

    Since it is thread safe by design, you might cache it in a public static final variable, or wrap it in a singleton pattern after creation for later access.

    youdao

  • 模式可能常用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.

    youdao

  • 模式非常有用设计模式,它允许对外提供实例但是犯的错误在于不止一个实例创建

    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.

    youdao

  • 模式有用的控制访问途径他能保证只有个类实例存在

    Singletons are a useful way to control access to a class, making sure that only one instance can exist.

    youdao

  • 比如数据库连接就是例设计模式一个例子:我们一般不想让应用程序具有连接池多个资源密集型实例

    An example use case for a singleton would be a database connection pool: you don't want your application to have multiple resource-intensive instances of a connection pool class.

    youdao

  • 一个可用创建实例需要每个特定的重写模式代码可重用的类。

    This is a class that can be used repeatedly to instantiate a class as a singleton without having to re-write the singleton pattern code for that specific class.

    youdao

  • 模式目的在于控制对象创建限制对外提供对象数量1同时允许情况变化时创建更多实例

    The singleton's purpose is to control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes.

    youdao

  • 相反Scala支持模式,可以应用于那些类型只有实例情况

    Instead, Scala supports a singleton object construct to support those cases where exactly one instance of a type is needed.

    youdao

  • 同时如果使用创建实例方法实现模式还具有创建多个实例变通能力。

    Likewise, with a singleton implemented as single instance, you leave open the possibility of altering the class to create more instances in the future.

    youdao

  • 模式确保只有一个实例提供一个全局访问

    The Singleton Pattern:ensures a class has only on instance, and provides a global point of access to it.

    youdao

  • 使用类来实现模式可以确保在任何时间只有一个实例对象

    Classes implementing Singleton pattern will ensure that only one instance of the object ever exists at any one time.

    youdao

  • 模式-每个依赖服务组件,都是获得服务工厂生成实例引用。服务是一个例对象或函数,对外提供特定的功能。

    Singletons - Each component dependent on a service gets a reference to the single instance generated by the service factory.

    youdao

  • 模式-每个依赖服务组件,都是获得服务工厂生成实例引用。服务是一个例对象或函数,对外提供特定的功能。

    Singletons - Each component dependent on a service gets a reference to the single instance generated by the service factory.

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定