Singleton

Overview

Ensure a class only has one instance, and provide a global point of access to it. Use the Singleton pattern when

Participants

Singleton

Specify a class, which should be instantiated only once.

Singleton Factory

Specify a class with a static method to instantiate Singleton.

Parameters

instanceField

In the "instanceField" attribute you can specify the name of an attribute where Singleton Factory will keep a reference to the (only) instance of Factory.

instanceMethod

In the "Instance method" field you can specify the name of a method for obtaining the Singleton object.