Debian Codegraph @

README

raw
1 Object-InsideOut version 4.05
2 =============================
3
4 This module provides comprehensive support for implementing classes using the
5 inside-out object model.
6
7 This module implements inside-out objects as anonymous scalar references that
8 are blessed into a class with the scalar containing the ID for the object
9 (usually a sequence number). Object data (i.e., fields) are stored within the
10 class's package in either arrays indexed by the object's ID, or hashes keyed
11 to the object's ID.
12
13 The virtues of the inside-out object model over the 'blessed hash' object
14 model have been extolled in detail elsewhere. Briefly, inside-out objects
15 offer the following advantages over 'blessed hash' objects:
16
17 * Encapsulation
18
19 Object data is enclosed within the class's code and is accessible only through
20 the class-defined interface.
21
22 * Field Name Collision Avoidance
23
24 Inheritance using 'blessed hash' classes can lead to conflicts if any classes
25 use the same name for a field (i.e., hash key). Inside-out objects are immune
26 to this problem because object data is stored inside each class's package, and
27 not in the object itself.
28
29 * Compile-time Name Checking
30
31 A common error with 'blessed hash' classes is the misspelling of field names:
32
33 $obj->{'coment'} = 'No comment'; # Should be 'comment' not 'coment'
34
35 As there is no compile-time checking on hash keys, such errors do not usually
36 manifest themselves until runtime.
37
38 With inside-out objects, data is accessed using methods, the names of which
39 are checked by the Perl compiler such that any typos are easily caught using
40 "perl -c".
41
42
43 This module offers all the capabilities of other inside-out object modules
44 with the following additional key advantages:
45
46 * Speed
47
48 When using arrays for storing object data, Object::InsideOut objects are as
49 much as 40% faster than 'blessed hash' objects for fetching and setting data,
50 and even with hashes they are still several percent faster than 'blessed hash'
51 objects.
52
53 * Threads
54
55 Object::InsideOut is thread safe, and thoroughly supports sharing objects
56 between threads using threads::shared.
57
58 * Flexibility
59
60 Allows control over object ID specification, accessor naming, parameter name
61 matching, and more.
62
63 * 'Runtime' Support
64
65 Supports classes that may be loaded at runtime (i.e., using "eval { require
66 ...; };"). This makes it usable from within mod_perl, as well. Also supports
67 additions to class hierarchies, and dynamic creation of object fields during
68 runtime.
69
70 * Perl 5.6
71
72 Tested on Perl v5.6.0 through v5.6.2, v5.8.0 through v5.8.8, and v5.9.3.
73
74 * Exception Objects
75
76 As recommended in "Perl Best Practices", Object::InsideOut uses
77 Exception::Class for handling errors in an OO-compatible manner.
78
79 * Object Serialization
80
81 Object::InsideOut has built-in support for object dumping and reloading that
82 can be accomplished in either an automated fashion or through the use of
83 class-supplied subroutines. Serialization using 'Storable' is also supported.
84
85 * Foreign Class Inheritance
86
87 Object::InsideOut allows classes to inherit from foreign (i.e.,
88 non-Object::InsideOut) classes, thus allowing you to sub-class other Perl
89 class, and access their methods from your own objects.
90
91 * Introspection
92
93 Obtain constructor parameters and method metadata for Object::InsideOut
94 classes.
95
96 INSTALLATION
97
98 To install this module type the following:
99
100 perl Makefile.PL
101 make
102 make test
103 make install
104
105 or if you have Module::Build installed:
106
107 perl Build.PL
108 perl Build
109 perl Build test
110 perl Build install
111
112 DEPENDENCIES
113
114 Requires Perl 5.6.0 or later.
115
116 This module uses the following 'standard' modules:
117
118 ExtUtils::MakeMaker - For installation
119 Test::More (0.50 or later) - For installation
120 Scalar::Util (1.10 or later) - Standard in 5.8 or obtain from CPAN
121 Data::Dumper
122 attributes
123 overload
124 B
125
126 This module requires the following module available from CPAN:
127
128 Exception::Class (1.22 or later)
129
130 Using the :lvalue accessor feature of this module requires the following
131 module from CPAN:
132
133 Want (0.12 or later)
134
135 For :SECURE mode, this module requires the following module from CPAN:
136
137 Math::Random::MT::Auto (5.04 or later)
138
139 COPYRIGHT AND LICENCE
140
141 Copyright 2005 - 2012 Jerry D. Hedden <jdhedden AT cpan DOT org>
142
143 This program is free software; you can redistribute it and/or modify it under
144 the same terms as Perl itself.
145
146 # EOF