1MakeMethods::Template::UIsnehrerCiotnatbrlieb(u3t)ed PerMlakDeoMceutmheondtsa:t:iToenmplate::Inheritable(3)
2
3
4

NAME

6       Class::MakeMethods::Template::Inheritable - Overridable data
7

SYNOPSIS

9         package MyClass;
10
11         use Class::MakeMethods( 'Template::Inheritable:scalar' => 'foo' );
12         # We now have an accessor method for an "inheritable" scalar value
13
14         MyClass->foo( 'Foozle' );   # Set a class-wide value
15         print MyClass->foo();       # Retrieve class-wide value
16
17         my $obj = MyClass->new(...);
18         print $obj->foo();          # All instances "inherit" that value...
19
20         $obj->foo( 'Foible' );      # until you set a value for an instance.
21         print $obj->foo();          # This now finds object-specific value.
22         ...
23
24         package MySubClass;
25         @ISA = 'MyClass';
26
27         print MySubClass->foo();    # Intially same as superclass,
28         MySubClass->foo('Foobar');  # but overridable per subclass,
29         print $subclass_obj->foo(); # and shared by its instances
30         $subclass_obj->foo('Fosil');# until you override them...
31         ...
32

DESCRIPTION

34       The MakeMethods subclass provides accessor methods that search an
35       inheritance tree to find a value. This allows you to set a shared or
36       default value for a given class, and optionally override it in a sub‐
37       class.
38
39       Standard Methods
40
41       The following methods from Generic should be supported:
42
43         scalar
44         string
45         string_index (?)
46         number
47         boolean (?)
48         bits (?)
49         array (?)
50         hash (?)
51         tiedhash (?)
52         hash_of_arrays (?)
53         object (?)
54         instance (?)
55         array_of_objects (?)
56         code (?)
57         code_or_scalar (?)
58
59       See Class::MakeMethods::Template::Generic for the interfaces and behav‐
60       iors of these method types.
61
62       The items marked with a * above are specifically defined in this pack‐
63       age, whereas the others are formed automatically by the interaction of
64       this package's generic settings with the code templates provided by the
65       Generic superclass.
66
67       The items marked with a ? above have not been tested sufficiently;
68       please inform the author if they do not function as you would expect.
69

SEE ALSO

71       See Class::MakeMethods for general information about this distribution.
72
73       See Class::MakeMethods::Template for more about this family of sub‐
74       classes.
75
76       See Class::MakeMethods::Template::Generic for information about the
77       various accessor interfaces subclassed herein.
78
79       If you just need scalar accessors, see Class::Data::Inheritable for a
80       very elegant and efficient implementation.
81
82
83
84perl v5.8.8                       2004-09-M0a6keMethods::Template::Inheritable(3)
Impressum