1MakeMethods::Emulator::USsienrglCeotnotnr(i3b)uted PerlMDaokceuMmeetnhtoadtsi:o:nEmulator::Singleton(3)
2
3
4

NAME

6       Class::MakeMethods::Emulator::Singleton - Emulate Class::Singleton
7

SYNOPSIS

9         use Class::MakeMethods::Emulator::Singleton;
10
11         # returns a new instance
12         my $one = Class::MakeMethods::Emulator::Singleton->instance();
13
14         # returns same instance
15         my $two = Class::MakeMethods::Emulator::Singleton->instance();
16

COMPATIBILITY

18       This module emulates the functionality of Class::Singleton, using
19       Class::MakeMethods to generate similar methods.
20
21       You may use it directly, as shown in the SYNOPSIS above,
22
23       Furthermore, you may call  "use Class::MakeMethods::Emulator::Singleton
24       '-take_namespace';" to alias the Class::Singleton namespace to this
25       package, and subsequent calls to the original package will be transpar‐
26       ently handled by this emulator. To remove the emulation aliasing, call
27       "use Class::MakeMethods::Emulator::Singleton '-release_namespace'".
28
29       Caution: This affects all subsequent uses of Class::Singleton in your
30       program, including those in other modules, and might cause unexpected
31       effects.
32

DESCRIPTION

34       A Singleton describes an object class that can have only one instance
35       in any system.  An example of a Singleton might be a print spooler or
36       system registry.  This module implements a Singleton class from which
37       other classes can be derived.  By itself, the Class::Singleton module
38       does very little other than manage the instantiation of a single
39       object.  In deriving a class from Class::Singleton, your module will
40       inherit the Singleton instantiation method and can implement whatever
41       specific functionality is required.
42

SEE ALSO

44       See Class::MakeMethods for general information about this distribution.
45
46       See Class::MakeMethods::Emulator for more about this family of sub‐
47       classes.
48
49       See Class::Singleton for documentation of the original module.
50
51       For a description and discussion of the Singleton class, see "Design
52       Patterns", Gamma et al, Addison-Wesley, 1995, ISBN 0-201-63361-2.
53
54       See "new" in Class::MakeMethods::Hash and "instance" in
55       Class::MakeMethods::ClassVar for documentation of the created methods.
56
57
58
59perl v5.8.8                       2004-09-06MakeMethods::Emulator::Singleton(3)
Impressum