Class::Meta::Express 0.04
Sponsored Links
Class::Meta::Express 0.04 Ranking & Summary
File size:
0.009 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1111
Date added:
2006-10-19
Publisher:
David Wheeler
Class::Meta::Express 0.04 description
Class::Meta::Express is a Perl module for concise, expressive creation of Class::Meta classes.
Synopsis
package My::Contact;
use Class::Meta::Express;
class {
meta contact => ( default_type => string );
has name;
has contact => ( required => 1 );
}
This module provides an interface to concisely yet expressively create classes with Class::Meta. Although I am of course fond of Class::Meta, Ive never been overly thrilled with its interface for creating classes:
package My::Thingy;
use Class::Meta;
BEGIN {
# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => thingy );
# Add a constructor.
$cm->add_constructor( name => new );
# Add a couple of attributes with generated accessors.
$cm->add_attribute(
name => id,
is => integer,
required => 1,
);
$cm->add_attribute(
name => name,
is => string,
required => 1,
);
$cm->add_attribute(
name => age,
is => integer,
);
# Add a custom method.
$cm->add_method(
name => chk_pass,
code => sub { return code },
);
$cm->build;
}
This example is relatively simple; it can get a lot more verbose. But even still, all of the method calls were annoying. I mean, whoever thought of using an object oriented interface for declaring a class? (Oh yeah: I did.) I wasnt alone in wanting a more declarative interface; Curtis Poe, with my blessing, created Class::Meta::Declare, which would use this syntax to create the same class:
package My::Thingy;
use Class::Meta::Declare :all;
Class::Meta::Declare->new(
# Create a Class::Meta object for this class.
meta => [
key => thingy,
],
# Add a constructor.
constructors => [
new => { }
],
# Add a couple of attributes with generated accessors.
attributes => [
id => {
type => $TYPE_INTEGER,
required => 1,
},
name => {
required => 1,
type => $TYPE_STRING,
},
age => { type => $TYPE_INTEGER, },
],
# Add a custom method.
methods => [
chk_pass => {
code => sub { return code },
}
]
);
This approach has the advantage of being a bit more concise, and it is declarative, but I find all of the indentation levels annoying; its hard for me to figure out where I am, especially if I have to define a lot of attributes. And finally, everything is a string with this syntax, except for those ugly read-only scalars such as $TYPE_INTEGER. So I cant easily tell where one attribute ends and the next one starts. Bleh.
Synopsis
package My::Contact;
use Class::Meta::Express;
class {
meta contact => ( default_type => string );
has name;
has contact => ( required => 1 );
}
This module provides an interface to concisely yet expressively create classes with Class::Meta. Although I am of course fond of Class::Meta, Ive never been overly thrilled with its interface for creating classes:
package My::Thingy;
use Class::Meta;
BEGIN {
# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => thingy );
# Add a constructor.
$cm->add_constructor( name => new );
# Add a couple of attributes with generated accessors.
$cm->add_attribute(
name => id,
is => integer,
required => 1,
);
$cm->add_attribute(
name => name,
is => string,
required => 1,
);
$cm->add_attribute(
name => age,
is => integer,
);
# Add a custom method.
$cm->add_method(
name => chk_pass,
code => sub { return code },
);
$cm->build;
}
This example is relatively simple; it can get a lot more verbose. But even still, all of the method calls were annoying. I mean, whoever thought of using an object oriented interface for declaring a class? (Oh yeah: I did.) I wasnt alone in wanting a more declarative interface; Curtis Poe, with my blessing, created Class::Meta::Declare, which would use this syntax to create the same class:
package My::Thingy;
use Class::Meta::Declare :all;
Class::Meta::Declare->new(
# Create a Class::Meta object for this class.
meta => [
key => thingy,
],
# Add a constructor.
constructors => [
new => { }
],
# Add a couple of attributes with generated accessors.
attributes => [
id => {
type => $TYPE_INTEGER,
required => 1,
},
name => {
required => 1,
type => $TYPE_STRING,
},
age => { type => $TYPE_INTEGER, },
],
# Add a custom method.
methods => [
chk_pass => {
code => sub { return code },
}
]
);
This approach has the advantage of being a bit more concise, and it is declarative, but I find all of the indentation levels annoying; its hard for me to figure out where I am, especially if I have to define a lot of attributes. And finally, everything is a string with this syntax, except for those ugly read-only scalars such as $TYPE_INTEGER. So I cant easily tell where one attribute ends and the next one starts. Bleh.
Class::Meta::Express 0.04 Screenshot
Class::Meta::Express 0.04 Keywords
Express 0.04
TYPE
INTEGER
Perl module
name
module
concise
classes
1
required
Class::Meta::Express
ClassMetaExpress
Class::Meta::Express 0.04
Libraries
Programming
Bookmark Class::Meta::Express 0.04
Class::Meta::Express 0.04 Copyright
WareSeeker periodically updates pricing and software information of Class::Meta::Express 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::Express 0.04 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Class::Meta::Declare is a Perl module deprecated in favor of Class::Meta::Express. Free Download
Class::Meta::Type is a Perl module for data type validation and accessor building. Free Download
Class::Meta is a Perl class automation, introspection, and data validation. Free Download
classesfaq is a Perl module with frequently asked questions about the Perl classes pragma. Free Download
Locale::Memories is a Perl module for L10N Message Retrieval. Free Download
Class::MOP is a Meta Object Protocol for Perl 5. Free Download
Class::DBI::ConceptSearch is a Perl module to retrieve Class::DBI aggregates from high-level conceptual searches. Free Download
Class::DBI::FormTools is a Perl module to build forms with multiple interconnected objects. Free Download
Latest Software
Popular Software
Favourite Software