Class::Declare::AttributesClass::Declare::Attributes is a Perl module with Class::Declare method types using Perl attributes. | |
Download |
Class::Declare::Attributes Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Ian Brayshaw
- Publisher web site:
- http://search.cpan.org/~ibb/Class-Declare-0.08/Declare.pm
Class::Declare::Attributes Tags
Class::Declare::Attributes Description
Class::Declare::Attributes is a Perl module with Class::Declare method types using Perl attributes. Class::Declare::Attributes is a Perl module with Class::Declare method types using Perl attributes.SYNOPSIS package My::Class; use 5.006; use strict; use warnings; use base qw( Class::Declare::Attributes ); # declare the class/instance attributes __PACKAGE__->declare( ... ); # # declare class/static/restricted/etc methods of this package # sub my_abstract : abstract { ... } sub my_class : class { ... } sub my_static : static { ... } sub my_restricted : restricted { ... } sub my_public : public { ... } sub my_private : private { ... } sub my_protected : protected { ... }Class::Declare::Attributes extends Class::Declare by adding support for Perl attributes for specifying class method types. This extension was inspired by Damian Conway's Attribute::Handlers module, and Tatsuhiko Miyagawa's Attribute::Protected module. The original implementation used Attribute::Handlers, but now simply refers to attributes.The addition of Perl attribute support (not to be confused with object attributes, which are entirely different, and also supported by Class::Declare) greatly simplifies the specification of Class::Declare-derived class and instance methods. This should aid in the porting of existing code (Perl, Java and C++) to a Class::Declare framework, as well as simplify the development of new modules.With the addition of Perl attributes, Class::Declare methods can now be written as sub method : public { my $self = shift; ... }instead of sub method { my $self = __PACKAGE__->public( shift ); ... }Requirements:· Perl Requirements: · Perl
Class::Declare::Attributes Related Software