Class::Meta::Declare 0.04
Sponsored Links
Class::Meta::Declare 0.04 Ranking & Summary
File size:
0.015 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
8759
Date added:
2006-09-27
Publisher:
Curtis Poe
Publisher URL:
http://search.cpan.org/~j
Class::Meta::Declare 0.04 description
Class::Meta::Declare is a Perl module deprecated in favor of Class::Meta::Express.
SYNOPSIS
This was a first attempt at making a saner interface for Class::Meta. It is nicer, but Class::Meta::Express is nicer still. Go use that one.
package MyApp::Thingy;
use Class::Meta::Declare :all;
use Data::UUID;
Class::Meta::Declare->new(
meta => [
key => thingy,
accessors => $ACC_SEMI_AFFORDANCE,
],
attributes => [
pi => {
context => $CTXT_CLASS,
authz => $AUTHZ_READ,
default => 3.1415927,
},
id => {
authz => $AUTHZ_READ,
type => $TYPE_STRING,
default => sub { Data::UUID->new->create_str },
},
name => {
required => 1,
type => $TYPE_STRING,
default => No Name Supplied,
},
age => { type => $TYPE_INTEGER, },
],
methods => [
some_method => {
view => $VIEW_PUBLIC,
code => sub {
my $self = shift;
return [ reverse @_ ];
},
}
]
);
my $object = MyApp::Thingy->new;
print MyApp::Thingy->pi; # prints 3.1415927
print $object->name; # prints "No Name Supplied;
$object->set_name("bob");
print $object->name; # prints "bob"
This class provides an alternate interface for Class::Meta.
Class::Meta is a useful module which allows one to create Perl classes which support introspection (also known as reflection). Typically Perl classes, when created, dont supply a lot of metadata. Imported helper functions show up when you call $object->can($method). Private, protected and trusted methods are not readily supported. Fetching a list of attributes or methods is a haphazard affair. Class::Meta overcomes these shortcomings by building the classes for you and allowing you to fetch a class object:
my $class_object = $object->my_class;
foreach my $attribute ( $class_object->attributes ) {
print $attribute->name, "n";
}
foreach my $method ( $class_object->methods ) {
print $method->name, "n";
}
If youve set up your class correctly, these properties are now easy to discover.
Unfortunately, many find the Class::Meta interface to be a bit clumsy. As an alternative, Class::Meta::Declare allows you to declare your entire class in a single argument list to the constructor and have the class built for you automatically. Further, reasonable defaults are provided for just about everything.
IMPORTANT: You want this class or Class::Meta if you need an introspection API for your classes. If you do not need introspection or dynamic class generation, these modules are overkill.
SYNOPSIS
This was a first attempt at making a saner interface for Class::Meta. It is nicer, but Class::Meta::Express is nicer still. Go use that one.
package MyApp::Thingy;
use Class::Meta::Declare :all;
use Data::UUID;
Class::Meta::Declare->new(
meta => [
key => thingy,
accessors => $ACC_SEMI_AFFORDANCE,
],
attributes => [
pi => {
context => $CTXT_CLASS,
authz => $AUTHZ_READ,
default => 3.1415927,
},
id => {
authz => $AUTHZ_READ,
type => $TYPE_STRING,
default => sub { Data::UUID->new->create_str },
},
name => {
required => 1,
type => $TYPE_STRING,
default => No Name Supplied,
},
age => { type => $TYPE_INTEGER, },
],
methods => [
some_method => {
view => $VIEW_PUBLIC,
code => sub {
my $self = shift;
return [ reverse @_ ];
},
}
]
);
my $object = MyApp::Thingy->new;
print MyApp::Thingy->pi; # prints 3.1415927
print $object->name; # prints "No Name Supplied;
$object->set_name("bob");
print $object->name; # prints "bob"
This class provides an alternate interface for Class::Meta.
Class::Meta is a useful module which allows one to create Perl classes which support introspection (also known as reflection). Typically Perl classes, when created, dont supply a lot of metadata. Imported helper functions show up when you call $object->can($method). Private, protected and trusted methods are not readily supported. Fetching a list of attributes or methods is a haphazard affair. Class::Meta overcomes these shortcomings by building the classes for you and allowing you to fetch a class object:
my $class_object = $object->my_class;
foreach my $attribute ( $class_object->attributes ) {
print $attribute->name, "n";
}
foreach my $method ( $class_object->methods ) {
print $method->name, "n";
}
If youve set up your class correctly, these properties are now easy to discover.
Unfortunately, many find the Class::Meta interface to be a bit clumsy. As an alternative, Class::Meta::Declare allows you to declare your entire class in a single argument list to the constructor and have the class built for you automatically. Further, reasonable defaults are provided for just about everything.
IMPORTANT: You want this class or Class::Meta if you need an introspection API for your classes. If you do not need introspection or dynamic class generation, these modules are overkill.
Class::Meta::Declare 0.04 Screenshot
Sponsored Links
Class::Meta::Declare 0.04 Keywords
Declare 0.04
TYPE
ClassMetaDeclare
MyApp
In favor of
Perl module
class
name
Perl
print
module
methods
Class::Meta::Declare 0.04
Libraries
Programming
Bookmark Class::Meta::Declare 0.04
Class::Meta::Declare 0.04 Copyright
WareSeeker periodically updates pricing and software information of Class::Meta::Declare 0.04 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Class::Meta::Declare 0.04 Edition. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Class::Meta::Declare 0.04 Related Software
HTML::Declare is a Perl module for When Template Systems Are Too Huge And Heredocs Too Messy.
Class::Declare is a Perl module created to declare classes with public, private and protected attributes and methods.
Class::Declare::Attributes is a Perl module with Class::Declare method types using Perl attributes.
Class::HPLOO is an easier way to declare classes on Perl, based in the popular class {...} style and ePod.
Getopt::Declare is a Perl module with Declaratively Expressed Command-Line Arguments via Regular Expressions.
Class::Meta::Express is a Perl module for concise, expressive creation of Class::Meta classes.
Class::Meta is a Perl class automation, introspection, and data validation.
Class::Meta::Type is a Perl module for data type validation and accessor building.
Object::Relation::Meta::Class::Schema is a Perl module for Object::Relation database store builder.
My Software
You have not saved any software. Click "Save" next to each software to save it to your software basket
Related Information
Sponsored Links
TOP POPULAR DOWNLOAD