• It is actually the real name of the singleton instance of the Unit type!

    事实上这是Unit类型单体实例的真正名字!

    youdao

  • Being close to wild roses in appearance, the singleton fits the unfussy modern garden.

    这种样子和野生蔷薇差不多的品种可以种植在那些不是很讲究的现代花园。

    youdao

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

    当单例类的副本运行于多个虚拟机中时,每个虚拟机都会为其创建一个实例对象。

    youdao

  • The constructor of BookWebApp gets the singleton instance of the book service implementation object.

    BookWebApp的构造函数获取这个图书服务实现对象的singleton实例。

    youdao

  • Listing 4 shows a version of the singleton that USES a method instead of an attribute to specify the appropriate class.

    清单4显示了使用方法而非属性来指定适当类的单例。

    youdao

  • To facilitate this, the plug-in class implements the singleton pattern: It stores a reference to itself in a private class variable.

    为了使这一点更方便,插件类实现单模式(singletonpattern):它在私有类变量中存储一个自身的引用。

    youdao

  • The only other method (set in italics) in the class is used to get a reference to the singleton and to create it if it is not yet instantiated.

    该类中仅剩的另一个方法(用斜体标识)用于获取该单件的一个引用,如果尚未实例化则创建它。

    youdao

  • If you add database connections or use a JDBC driver that allows multithreading, the singleton can be easily adjusted to allow more connections.

    当你增加数据库连接或者改而使用支持多线程的JDBC驱动器时,单例模式能够很容易地适应这一变化。

    youdao

  • As I discuss the singleton, keep the above implementations in mind, although many of those phenomena can occur for any implementation of the singleton.

    本文讨论的主题是单例模式,请将上述实现方式牢记于心,因为接下来的现象可能出现在任何一种实现方式中。

    youdao

  • With some implementations of the singleton, you allow writers of subclasses to override methods polymorphically, something not possible with static methods.

    最后,在单例模式的一些实现方式中,单例类的子类能够动态地重载方法,这是静态方法所不能办到的。

    youdao

  • Now, we can call the reset method to start off each test run to ensure we are going through the initialization code for the singleton object on every test run.

    现在,我们可以在每次测试之前调用reset方法,保证我们在每次测试过程中都会先执行singleton对象的初始化代码。

    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

  • Whereas the singleton implementation uses the subclass's class name, other patterns (such as active record, covered later) need to reference other static properties.

    尽管单例实现使用的是子类的类名,其他的模式(比如稍后介绍的活动记录模式)需要引用其他的静态属性。

    youdao

  • After discussing how to implement the singleton, I'll go over the sometimes surprising causes for the phenomena one by one, showing you how they occur and how you can avoid making those mistakes.

    在讨论了如何实现单例模式之后,我会逐一介绍这些时而出现的诡异现象,讲解它们是怎么出现的以及如何去避免犯错。

    youdao

  • The Singleton pattern is shown in Figure 5.

    Singleton模式如图5所示。

    youdao

  • The Singleton creation pattern is a common programming idiom.

    单例创建模式是一个通用的编程习语。

    youdao

  • Doing so creates an instance of the Singleton Pattern in the Model Explorer.

    执行此操作将会在模型浏览器中生成一个Singleton模式的实例。

    youdao

  • The singleton pattern can be used to delay the initialization of an object as long as possible.

    单元素模式可以用来尽可能久地延迟对象的初始化。

    youdao

  • To create an instance of the Factory Method Pattern, perform the same steps as for the Singleton Pattern.

    要创建Factory方法模式的实例,执行同Singleton模式相同的步骤。

    youdao

  • The major disadvantage of using a Singleton, as we did here, is that you must clear the Singleton between each test.

    正如我们在此所做的,使用Singleton的主要缺点是:您必须在各次测试之间清除Singleton。

    youdao

  • The code at BE allocates the memory from the heap for the Singleton object and stores a pointer to that memory in eax.

    be处的代码为Singleton对象从堆中分配内存,并将一个指向该块内存的指针存储到eax中。

    youdao

  • Most caches are implemented using the Singleton pattern involving a static reference to a top level cache class as shown in this example.

    使用Singleton模式实现的大多数缓存都涉及本例所示的对顶级cache类的静态引用。

    youdao

  • The problem with this line of code is that the variable instance can become non-null before the body of the Singleton constructor executes.

    这行代码的问题是:在Singleton构造函数体执行之前,变量instance可能成为非null的。

    youdao

  • The singleton, builder, and factory method design patterns are considered creational patterns, as they assist in the construction of objects.

    单例、生成器和工厂方法设计模式被视为是创建型的模式,因它们可协助对象的构建。

    youdao

  • 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.

    单例模式可能是最常用的OOP设计模式之一了;它限制了一个类的对象实例数只能为1。

    youdao

  • The Singleton session bean lives for the duration of the container in which it is created but state does not survive a shut-down or a crash of the JVM.

    单例sessionbean的生命周期与创建它的容器保持一致,但是其状态会因为JVM的停止或崩溃而丧失。

    youdao

  • Users of the class can then add and remove Attendee elements from the collection the Singleton instance holds, or replace the elements in the collection.

    然后,该类的用户可以在Singleton实例保存的集合中添加和删除Attendee元素,或替换集合中的元素。

    youdao

  • Typical examples include a cached DAO, cache of JNDI references, or any sort of common factory or other component that needs to use the Singleton pattern.

    典型的例子有:缓存的DAO,JNDI引用的缓存,或者任何类型的公共工厂或者其他需要使用Singleton模式的组件。

    youdao

  • Using the Singleton pattern we guarantee that no matter how many times the BusinessLayerProxy tries to create a CommandFactory, only one instance will exist.

    使用Singleton模式,我们可以保证无论BusinessLayerProxy多少次尝试建立CommandFactory,也只存在一个实例。

    youdao

  • As an EJB, the Singleton has access to the standard set of EJB middleware services - transaction management, security, remoteing, dependency injection and so on.

    作为一个EJB,该单例可以访问标准的EJB中间件服务集——事务管理、安全、远程、依赖注入等等。

    youdao

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

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

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