Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.891.979 Times

Class::Meta::Express 0.04

  Date Added: November 03, 2010  |  Visits: 518

Class::Meta::Express

Report Broken Link
Printer Friendly Version


Product Homepage
Download (70 downloads)



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..

Requirements: No special requirements
Platforms: Linux
Keyword: Classmetaexpress Concise Integer Interface Libraries Method Module Name Perl Module Programming Required Type
Users rating: 0/10

License: Freeware Size: 9.22 KB
USER REVIEWS
More Reviews or Write Review


CLASS::META::EXPRESS RELATED
Libraries  -  Sys::Lastlog 1.5
Sys::Lastlog is a Perl module to provide a moderately Object Oreiented Interface to lastlog files on some Unix-like systems. SYNOPSIS use Sys::Lastlog; my $ll = Sys::Lastlog->new(); while(my $llent = $ll->getllent() ) { print...
6.14 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  dtRdr::Traits::Class 0.0.11
dtRdr::Traits::Class is a Perl module with shared OO stuff. Methods to Break Things NOT_IMPLEMENTED Imported into base class. Gives a nicer message than the standard "Cant locate method...", indicating that you did not typo the method name,...
2.8 MB  
Libraries  -  Catalyst::Plugin::Dumper 0.000002
Catalyst::Plugin::Dumper is a Perl module with Data::Dumper plugin for Catalyst. SYNOPSIS use Catalyst qw/-Debug Dumper/; $c->log->dumper($myvar); $c->log->dumper($myvar, mylabel); This plugin injects a dumper() method into the...
4.1 KB  
Libraries  -  Mac::Apps::Seasonality::Constants 0.0.4
Mac::Apps::Seasonality::Constants is a Perl module for static definitions of aspects of Seasonality. SYNOPSIS use Mac::Apps::Seasonality::Constants qw{ $SEASONALITY_NAME $SEASONALITY_CREATOR $SEASONALITY_HISTORY_DATABASE_PATH }; use...
8.19 KB  
Libraries  -  DBD::ADO::Const 2.95
DBD::ADO::Const is a Perl module for ADO Constants. SYNOPSIS use DBD::ADO::Const(); $ = "n"; my $Enums = DBD::ADO::Const->Enums; for my $Enum ( sort keys %$Enums ) { print $Enum; for my $Const ( sort keys %{$Enums->{$Enum}} ) {...
43.01 KB  
Libraries  -  Sys::Hostname::Long 1.4
Sys::Hostname::Long is a Perl module to try every conceivable way to get full hostname. SYNOPSIS use Sys::Hostname::Long; $host_long = hostname_long; How to get the host full name in perl on multiple operating systems (mac, windows, unix*...
5.12 KB  
Libraries  -  Games::Sudoku::General 0.007
Games::Sudoku::General is a Perl module that can solve sudoku-like puzzles. SYNOPSIS $su = Games::Sudoku::General->new (); print $su->problem( solution(); 3 . . . . 8 . 2 . . . . . . 9 . . . . . 2 7 . 5 . . . 2 4 . 5 . . 8 . . . 8...
40.96 KB  
Libraries  -  Test::LectroTest 0.3500
Test::LectroTest is a Perl module with easy, automatic, specification-based tests. SYNOPSIS #!/usr/bin/perl -w use MyModule; # contains code we want to test use Test::LectroTest; Property { ##[ x <- Int, y <- Int ]##...
54.27 KB  
Libraries  -  Sys::PortIO 0.1
Sys::PortIO is a Perl module to perform direct port I/O from Perl. SYNOPSIS use Sys::PortIO; port_open($portnum); write_byte($portnum, $value); $value = read_byte($portnum); port_close($portnum); This module provides a Perl interface to...
737.28 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB