• 原因在于多个虚拟机可以涉及相同实例,这些单实例对象可能会同时存在于上下文中,从而导致这些单实例对象不是全局唯一的

    The instance fields of the singleton will not be globally unique. Because several VMs are involved for what appears to be the same object, several singleton objects might be brought into existence.

    youdao

  • 由于例对象作为实例存在而不是静态成员,所以能够惰性初始例对象,即需要在第一次时候去创建它。

    With singletons implemented as single instances instead of static class members, you can initialize the singleton lazily, creating it only when it is first used.

    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

  • 相反可以定义对象(而不是)并且将成为实例

    Instead you can define some as an object (instead of a class) and it becomes a singleton instance of the class.

    youdao

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

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

    youdao

  • 由于实例也是实例,所以可能出现多个实例并存的情况。

    Since an instance of a subclass is an instance of your superclass, you could find multiple instances of the singleton.

    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

  • 副本运行多个虚拟中时,每个虚拟机都会创建一个实例对象

    When copies of the singleton class run in multiple VMs, an instance is created for each machine.

    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

  • 我们数据库当作一个实例对象,database限制1个实例

    We made our database a singleton in order to limit the database class to only one instance.

    youdao

  • 提供一组(singleton)对象实例一个JAX-RS应用程序包括所有根级别资源提供程序(由 @Provider注释)。

    This class provides a set of classes, or a set of singleton object instances, that include all of the root-level resources and providers (classes annotated with @Provider) in a JAX-RS application.

    youdao

  • 创建一个SingletonFactory去全局映射(或者对象)实例对象。

    You can have a SingletonFactory class with a globally accessible map of class names or class objects to singleton instances.

    youdao

  • 单实例对象Message作为message存储库工厂

    The Message singleton serves as a metadata repository and factory class for the Message class.

    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

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

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

    youdao

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

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

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