1MakeMethods::Emulator(3U)ser Contributed Perl DocumentatiMoankeMethods::Emulator(3)
2
3
4
6 Class::MakeMethods::Emulator - Demonstrate class-generator equivalency
7
9 # Equivalent to use Class::Singleton;
10 use Class::MakeMethods::Emulator::Singleton;
11
12 # Equivalent to use Class::Struct;
13 use Class::MakeMethods::Emulator::Struct;
14 struct ( ... );
15
16 # Equivalent to use Class::MethodMaker( ... );
17 use Class::MakeMethods::Emulator::MethodMaker( ... );
18
19 # Equivalent to use base 'Class::Inheritable';
20 use base 'Class::MakeMethods::Emulator::Inheritable';
21 MyClass->mk_classdata( ... );
22
23 # Equivalent to use base 'Class::AccessorFast';
24 use base 'Class::MakeMethods::Emulator::AccessorFast';
25 MyClass->mk_accessors(qw(this that whatever));
26
27 # Equivalent to use accessors( ... );
28 use Class::MakeMethods::Emulator::accessors( ... );
29
30 # Equivalent to use mcoder( ... );
31 use Class::MakeMethods::Emulator::mcoder( ... );
32
34 In several cases, Class::MakeMethods provides functionality closely
35 equivalent to that of an existing module, and it is simple to map the
36 existing module's interface to that of Class::MakeMethods.
37
38 Class::MakeMethods::Emulator provides emulators for Class::MethodMaker,
39 Class::Accessor::Fast, Class::Data::Inheritable, Class::Singleton,
40 Class::Struct, accessors, and mcoder, each of which passes the original
41 module's test suite, usually requiring only the addition of a a single
42 line to each test, activating the emulation module.
43
44 Beyond demonstrating compatibility, these emulators also generally
45 indicate the changes needed to switch to direct use of Class::MakeMeth‐
46 ods functionality, illustrate commonalities between the various mod‐
47 ules, and serve as a source for new ideas that can be integrated into
48 Class::MakeMethods.
49
51 See Class::MakeMethods for general information about this distribution.
52
53 See Class::MakeMethods::Emulator::accessors, and accessors from CPAN.
54
55 See Class::MakeMethods::Emulator::Struct, and Class::Struct from CPAN.
56
57 See Class::MakeMethods::Emulator::AccessorFast, and Class::Acces‐
58 sor::Fast from CPAN.
59
60 See Class::MakeMethods::Emulator::Inheritable, and Class::Data::Inheri‐
61 table from CPAN.
62
63 See Class::MakeMethods::Emulator::MethodMaker, and Class::MethodMaker
64 from CPAN.
65
66 See Class::MakeMethods::Emulator::Singleton, and Class::Singleton from
67 CPAN.
68
69 See Class::MakeMethods::Emulator::mcoder, and mcoder from CPAN.
70
71
72
73perl v5.8.8 2004-09-06 MakeMethods::Emulator(3)