17 lines
735 B
Text
17 lines
735 B
Text
|
The Perl 5 module Object::InsideOut provides comprehensive support
|
||
|
for implementing classes using the inside-out object model.
|
||
|
|
||
|
It implements inside-out objects as anonymous scalar references
|
||
|
that are blessed into a class with the scalar containing the ID
|
||
|
for the object (usually a sequence number). Object data (i.e.,
|
||
|
fields) are stored within the class's package in either arrays
|
||
|
indexed by the object's ID, or hashes keyed to the object's ID.
|
||
|
|
||
|
The virtues of the inside-out object model over the 'blessed hash'
|
||
|
object model have been extolled in detail elsewhere. Briefly,
|
||
|
inside-out objects offer the following advantages over 'blessed
|
||
|
hash' objects:
|
||
|
* Encapsulation
|
||
|
* Field Name Collision Avoidance
|
||
|
* Compile-time Name Checking
|