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模式的组件。
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 ,也只存在一个实例。
Unless the settings wrapper class is designed using the singleton pattern , there can be multiple instances of the same application settings class in a single application 除非使用单一实例模式来设计设置包装类,否则单个应用程序中可能存在同一个应用程序设置类的多个实例。
Since there can be only one un - caught handler per process active at a time , the constructor should be invoked only once ; hence , the reason for the singleton pattern 因为每次只能有一个未捕获的处理程序处理一个活动进程,构造函数应该只被调用一次,因此要采用singleton模式。
The framework we ll create is a simple 3 - tier framework that processes business logic using three patterns : the 3 - layer architecture pattern , the singleton pattern , and the command pattern 我们将要建立的是一个简单的3 - tier框架,它使用了三种模式处理业务逻辑: 3 - layer体系结构模式、 singleton模式和command模式。
In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.