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

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

Serving Software Downloads in 956 Categories, Downloaded 50.325.556 Times

Method::Declarative 0.03

  Date Added: July 24, 2010  |  Visits: 839

Method::Declarative

Report Broken Link
Printer Friendly Version


Product Homepage
Download (92 downloads)



Method::Declarative is a Perl module to create methods with declarative syntax. SYNOPSIS use Method::Declarative ( --defaults => { precheck => [ [ qw(precheck1 arg1 arg2) ], # ... ], postcheck => [ [ qw(postcheck1 arg3 arg4) ], # ... ], init => [ [ initcheck1 ], # ... ], end => [ [ endcheck1 ], # ... ], once => [ [ oncecheck1 ], ] , package => __CALLER__::internal, }, method1 => { ignoredefaults => [ qw(precheck end once) ], code => __method1, }, ) ; The Method::Declarative module creates methods in a using class namespace. The methods are created using a declarative syntax and building blocks provided by the using class. This class does not create the objects themselves. The using class invokes Method::Declarative, passing it list of key-value pairs, where each key is the name of a method to declare (or the special key --default) and a hash reference of construction directives. The valid keys in the construction hash refs are: code The value corresponding to code key is a method name or code reference to be executed as the method. It is called like this: $obj->$codeval(@args) where $obj is the object or class name being used, $codeval is the coresponding reference or method name, and @args are the current arguments for the invocation. If $codeval is a method name, it needs to be reachable from $obj. A code key in a method declaration will override any code key set in the --defaults section. end The value corresponding to the end key is an array reference, where each entry of the referenced array is another array ref. Each of the internally referenced arrays starts with a code reference or method name. The remaining elements of the array are used as arguments. Each method declared by the arrays referenced from end are called on the class where the declared method resides in an END block when Method::Declarative unloads. Each method is called like this: $pkg->$codeval($name[, @args]); where $pkg is the package or class name for the method, $name is the method name, and @args is the optional arguments that can be listed in each referenced list. end blocks are run in the reverse order of method declaration (for example, if method1 is declared before method2, method2s end declaration will be run before method1s), and for each method they are run in the order in which they are declared. Note that this is not an object destructor, and no objects of a particular class may still exist when these methods are run. ignoredefaults The value corresponding to the ignoredefaults key is an array reference pointing to a list of strings. Each string must corespond to a valid key, and indicates that any in-force defaults for that key are to be ignored. See the section on the special --defaults method for details. init The value corresponding to the init key is identical in structure to that corresponding to the end key. The only difference is that the declared methods/code refs are executed as soon as the method is available, rather than during an END block. once The value corresponding to the once key is identical in structure to that corresponding to the end key. The values are used when the method is invoked, however. If the method is invoked on an object based on a hash ref, or on the class itself, and it has not been invoked before on that object or hash ref, the methods and code refs declared by this key are executed one at a time, like this: $obj->$codeval($name, $isscalar, $argsref[, @args ]); where $obj is the object or class on which the method is being invoked, $codeval is the method name or code reference supplied, $name is the name of the method, $isscalar is a flag to specify if the declared method itself is being executed in a scalar context, $argsref is a reference to the method arguments (@_, in other words), and @args are any optional arguments in the declaration. The return value of each method or code reference call is used as the new arguments array for successive iterations or the declared method itself (including the object or class name). Yes, that means that these functions can change the the object or class out from under successive operations. Any method or code ref returning an empty list will cause further processing for the method to abort, and an empty list or undefined value (as appropriate for the context) will be returned as the declared methods return value. package The value coresponding to the package key is a string that determines where the declared method is created (which is the callers package by default, unless modified with a --defaults section). The string __CALLER__ can be used to specify the callers namespace, so constructions like the one in the synopsis can be used to create methods in a namespace based on the calling package namespace. postcheck The value coresponding to the postcheck key is identical in structure to that coresponding to the end key. The postcheck operations are run like this: $obj->$codeval($name, $isscalar, $vref[, @args ]); where $obj is the underlying object or class, $codeval is the method or code ref from the list, $name is the name of the declared method, $isscalar is the flag specifying if the declared method was called in a scalar context, $vref is an array reference of the currently to-be-returned values, and @args is the optional arguments from the list. Each method or code reference is expected to return the value(s) it wishes to have returned from the method. Returning a null list does NOT stop processing of later postcheck declarations. precheck The precheck phase operates similarly to the once phase, except that its triggered on all method calls (even if the underlying object is not a hash reference or a class name). Any illegal or unrecognized key will cause a warning, and processing of the affected hashref will stop. This means a --defaults section will be ineffective, or a declared method wont be created..

Requirements: No special requirements
Platforms: Linux
Keyword: Class Class Name Code Create Methods Declared End Key Key Method Method Name Methoddeclarative Name Perl Module To Create To The End
Users rating: 0/10

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


METHOD::DECLARATIVE RELATED
Libraries  -  Rose::Class::MakeMethods::Set 0.84
Rose::Class::MakeMethods::Set is a Perl module to create class methods to manage sets. SYNOPSIS package MyClass; use Rose::Class::MakeMethods::Set ( inheritable_set => [ required_name => { add_implies => add_valid_name, test_method =>...
28.67 KB  
Libraries  -  Class::Method::hash 2.08
Class::Method::hash is a Perl module that helps you create methods for handling a hash value. SYNOPSIS use Class::MethodMaker [ hash => [qw/ x /] ]; $instance->x; # empty $instance->x(a => 1, b => 2, c => 3); $instance->x_count == 3; #...
89.09 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  -  Class::Std::Storable 0.0.1
Class::Std::Storable is a Perl module to support for creating serializable "inside-out" classes. SYNOPSIS In general, use this class exactly as you would Class::Std. package Ice::Cream; use Class::Std::Storable; { my %name_of :ATTR( :get...
8.19 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::Std 0.0.8
Class::Std is a Perl module to support for creating standard "inside-out" classes. SYNOPSIS package MyClass; use Class::Std; # Create storage for object attributes... my %name : ATTR; my %rank : ATTR; my %snum : ATTR; my %public_data :...
30.72 KB  
Libraries  -  Class::DBI::FormTools 0.0.4
Class::DBI::FormTools is a Perl module to build forms with multiple interconnected objects. SYNOPSIS package MyApp::Film; use base Class::DBI::FormTools; Mason example my $o = Film->retrieve(42); < input...
9.22 KB  
Libraries  -  Class::CGI 0.20
Class::CGI is a Perl module to fetch objects from your CGI object. SYNOPSIS use Class::CGI handlers => { customer_id => My::Customer::Handler }; my $cgi = Class::CGI->new; my $customer = $cgi->param(customer_id); my $name =...
17.41 KB  
Libraries  -  Class::DBI::ConceptSearch 0.04
Class::DBI::ConceptSearch is a Perl module to retrieve Class::DBI aggregates from high-level conceptual searches. SYNOPSIS my $cs = Class::DBI::ConceptSearch->new(xml => $config); #see CONFIGURATION $cs->use_wildcards(1);...
7.17 KB  
Libraries  -  Class::DBI::AutoIncrement 0.05
Class::DBI::AutoIncrement is a Perl module to emulate auto-incrementing columns on Class::DBI subclasses. SYNOPSIS Lets assume you have a project making use of Class::DBI. You have implemented a subclass of Class::DBI called MyProject::DBI...
8.19 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 4.0.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...
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