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 32.403.004 Times

Class::Meta 0.53

  Date Added: February 10, 2010  |  Visits: 734

Class::Meta

Report Broken Link
Printer Friendly Version


Product Homepage
Download (73 downloads)



Class::Meta is a Perl class automation, introspection, and data validation. SYNOPSIS Generate a class: package MyApp::Thingy; use strict; use Class::Meta; use Class::Meta::Types::String; use Class::Meta::Types::Numeric; BEGIN { # Create a Class::Meta object for this class. my $cm = Class::Meta->new( key => thingy ); # Add a constructor. $cm->add_constructor( name => new, create => 1, ); # Add a couple of attributes with generated methods. $cm->add_attribute( name => uuid, authz => Class::Meta::READ, type => string, required => 1, default => sub { Data::UUID->new->create_str }, ); $cm->add_attribute( name => name, is => string, required => 1, default => undef, ); $cm->add_attribute( name => age, is => integer, default => undef, ); # Add a custom method. $cm->add_method( name => chk_pass, view => Class::Meta::PUBLIC, ); $cm->build; } Then use the class: use MyApp::Thingy; my $thingy = MyApp::Thingy->new; print "ID: ", $thingy->id, $/; $thingy->name(Larry); print "Name: ", $thingy->name, $/; $thingy->age(42); print "Age: ", $thingy->age, $/; Or make use of the introspection API: use MyApp::Thingy; my $class = MyApp::Thingy->my_class; my $thingy; print "Examining object of class ", $class->package, $/; print "nConstructors:n"; for my $ctor ($class->constructors) { print " o ", $ctor->name, $/; $thingy = $ctor->call($class->package); } print "nAttributes:n"; for my $attr ($class->attributes) { print " o ", $attr->name, " => ", $attr->get($thingy), $/; if ($attr->authz >= Class::Meta::SET && $attr->type eq string) { $attr->get($thingy, hey there!); print " Changed to: ", $attr->get($thingy), $/; } } print "nMethods:n"; for my $meth ($class->methods) { print " o ", $meth->name, $/; $meth->call($thingy); } Class::Meta provides an interface for automating the creation of Perl classes with attribute data type validation. It differs from other such modules in that it includes an introspection API that can be used as a unified interface for all Class::Meta-generated classes. In this sense, it is an implementation of the "Facade" design pattern..

Requirements: No special requirements
Platforms: Linux
Keyword: Class Classmeta Data Introspection Libraries Myapp Name Print Programming Thingy
Users rating: 0/10

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


CLASS::META RELATED
Libraries  -  VCS 0.14
VCS project is a Perl library for generic Version Control System access in Perl. SYNOPSIS use VCS; $file = VCS::File->new($ARGV[0]); print $file->url, ":n"; for $version ($file->versions) { print $version->version, was checked in by ,...
21.5 KB  
Libraries  -  libbsl 0.9.1
libbsl (Basic System Library) is a powerful, easy to use and fully thread safe C++ template class library for frequently recurring (machine/OS oriented) programming problems. All fundamental objects in libbsl are freely copyable and shareable...
1.04 MB  
Business  -  SSuite Office - MonoBase 2.0.0.3
Features Available: - Create unlimited databases with unlimited tables, fields, and rows - Access any ODBC compatible database of any size, from 1 Kilobyte to 1 Terabyte - Filter tables instantly - Run SQL statements with the SQL query engine -...
9.32 MB  
Business  -  TS Client 1.1.1
TS Client is a multi-user desktop application to register data of clients like name, address, contact details, prescriptions and simple invoicing and payment requirements.The program is developed in 100% pure Java.It runs right out of the box.
4.74 MB  
Libraries  -  ViennaData 1.0.1
ViennaData is a C++ library that allows to separate intrinsic properties of a class from data associated to objects of that class. This allows to write code that is much more reusable than traditional designs.
517.54 KB  
Libraries  -  Class::Meta::Declare 0.04
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...
15.36 KB  
Libraries  -  DBIx::Class::LibXMLdoc 0.03
DBIx::Class::LibXMLdoc is a Perl module to create an adjunct "Doc" accessor of a columns data which is automatically parsed into a LibXML documentElement (alpha-software). SYNOPSIS package My::DB::thingy; __PACKAGE__->load_components(qw/...
5.12 KB  
Libraries  -  SOAP::Data::ComplexType 0.041
SOAP::Data::ComplexType is an abstract class for creating and handling complex SOAP::Data objects. SYNOPSIS package My::SOAP::Data::ComplexType::Foo; use strict; use warnings; use SOAP::Data::ComplexType; use vars qw(@ISA); @ISA =...
13.31 KB  
Libraries  -  Class::DBI::Plugin::FilterOnClick 1.0
Class::DBI::Plugin::FilterOnClick is a Perl module to generate browsable and searchable HTML Tables using FilterOnClick in conjunction with Class::DBI. SYNOPSIS # Inside of your sub-class of Class::DBI add these lines: use...
24.58 KB  
Libraries  -  Class::IntrospectionMethods 1.003
Class::IntrospectionMethods is a Perl module that creates methods with introspection. SYNOPSIS use Class::IntrospectionMethods qw/make_methods/; make_methods ( parent, global_catalog => { name => metacat, list => [ [qw/foo/] =>...
31.74 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 3.15.3
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...
3.88 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