Lexical::AttributesProper encapsulation | |
Download |
Lexical::Attributes Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Abigail
- Publisher web site:
- http://search.cpan.org/~abigail/
Lexical::Attributes Tags
Lexical::Attributes Description
Proper encapsulation Lexical::Attributes is a Perl module that offers proper encapsulation.SYNOPSIS use Lexical::Attributes; has $.scalar; has $.key ro; has (@.array, %.hash) is rw; sub method { $self -> another_method; print $.scalar; }NOTE: This module has changed significantly between releases 1.3 and 1.4. Code that works with version 1.3 or earlier will not work with version 1.4 or later.NOTE: This is experimental software! Certain things will change, specially if they are marked FIXME or mentioned on the TODO list.This module was created out of frustration with Perl's default OO mechanism, which doesn't offer good data encapsulation. I designed the technique of Inside-Out Objects several years ago, but I was not really satisfied with it, as it still required a lot of typing. This module uses a source filter to hide the details of the Inside-Out technique from the user.Attributes, the variables that belong to an object, are stored in lexical hashes, instead of piggy-backing on the reference that makes the object. The lexical hashes, one for each attribute, are indexed using the object. However, the details of this technique are hidden behind a source filter. Instead, attributes are declared in a similar way as lexical variables. Except that instead of my, a Perl6 keyword, has is used. Another thing is borrowed from Perl6, and that's the second sigil. Attributes have a dot separating the sigil from the name of attribute. Requirements: · Perl
Lexical::Attributes Related Software