• Jeremy认为大多数开发者没有正确使用Ruby对象所以话题比较高阶,谈论了诸如单例类(singleton classes)instance_eval。

    Jeremy believes that most programmers don't use Ruby's objects right, so his talk sheds some light onto advanced topics like singleton classes and the instance_eval.

    youdao

  • 这样分离结构代码有利于保持按单例模式使用或不按单例模式使用的灵活性。

    This has the added benefit of separating singleton code from the class code leaving the flexibility to use several instances of the class or using the class as a singleton.

    youdao

  • 3单例显然更为准确更为重要一点使用PHPLSB引用适当的覆盖静态

    The singleton in Listing 3 is certainly more concise, but what's important is the use of PHP's LSB to reference the appropriate overridden static attribute.

    youdao

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

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

    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

  • 一个Scala单例(singleton),因为使用对象声明而不是声明。

    This is a Scala singleton because it USES the object declaration instead of a class declaration.

    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

  • 使用这个需要复制代码可以实现任意单例

    So with this class we can makeany class singleton, without duplicating the code.

    youdao

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

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

    youdao

  • 什么时候使用带有静态成员,什么时候使用

    When would you use a class with static members and when would you use a Singleton class?

    youdao

  • 什么时候使用带有静态成员,什么时候使用

    When would you use a class with static members and when would you use a Singleton class?

    youdao

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

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

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