1·Instead you can define some as an object (instead of a class) and it becomes a singleton instance of the class.
相反您可以定义一个对象(而不是类)并且它将成为类的一个单例实例。
2·Through this functionality, you can use the popular singleton pattern.
通过使用这种功能,您可以使用流行的单例模式。
3·In that case, a new singleton object will be created.
在这种情况下,一个新的单例对象会被创建。
4·Therefore, use of a singleton instance for JAX-RS resources should be avoided unless carefully planned.
因此,除非仔细计划,否则应该避免使用JAX - RS资源的单例实例。
5·Both UI components and the Application object (which is a singleton) can receive system events.
UI组件和应用对象(这是一个单例)都能收到系统事件。
1·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.
该类中仅剩的另一个方法(用斜体标识)用于获取该单件的一个引用,如果尚未实例化则创建它。
2·The first component to move towards the service locator design, and away from its singleton origins, is the one that depends on no other singletons, yet may be depended by other singletons.
迈向服务定位器设计、摆脱单件血统的第一个组件是不依赖于其它单件、但被其它单件依赖的组件。
3·Also does the DI container get populated with the results of singleton lookups initially, with TODO comments promising a revisit later?
抑或是先用单件查找的结果填充DI容器,写上TODO注释表示以后再完善吗?