• The API is straightforward: You call a singleton method and get back a connection object.

    API直观:调用单个方法返回一个连接对象。

    youdao

  • The DefaultDAO class stores an instance of itself (as a Singleton) in the static variable instance, allowing access to that instance through the getInstance() method.

    DefaultDAO静态变量instance 中存储了它自己一个实例(存储Singleton),并允许通过getInstance()方法访问实例。

    youdao

  • The static getInstance method contains the template code for a singleton.

    静态getInstance方法包含单例的模板代码

    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

  • This method in turn creates the container (which ACTS as a singleton) and registers components and their parameters.

    这个方法然后创建容器(充当单体)注册组件组件的参数

    youdao

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

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

    youdao

  • Having this method available can be helpful in the application in general because now the singleton becomes easily mutable.

    总之应用程序中增加这个方法很有用的,因为我们现在可以轻松地修改单一实例

    youdao

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

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

    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

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

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

    youdao

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

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

    youdao

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

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

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