Class::MakeMethods::Template

Class::MakeMethods::Template package contains extensible code templates.
Download

Class::MakeMethods::Template Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matthew Simon Cavalletto
  • Publisher web site:
  • http://search.cpan.org/~ferrency/

Class::MakeMethods::Template Tags


Class::MakeMethods::Template Description

Class::MakeMethods::Template package contains extensible code templates. Class::MakeMethods::Template package contains extensible code templates.SYNOPSIS package MyObject; use Class::MakeMethods::Template::Hash ( 'new' => 'new', 'string' => 'foo', 'number' => 'bar', ); my $obj = MyObject->new( foo => "Foozle", bar => 23 ); print $obj->foo(); $obj->bar(42);MOTIVATIONIf you compare the source code of some of the closure-generating methods provided by other subclasses of Class::MakeMethods, such as the hash accessors provided by the various Standard::* subclasses, you will notice a fair amount of duplication. This module provides a way of assembling common pieces of code to facilitate support the maintenance of much larger libraries of generated methods.This module extends the Class::MakeMethods framework by providing an abstract superclass for extensible code-templating method generators.Common types of methods are generalized into template definitions. For example, Template::Generic's new provides a template for methods that create object instances, while Template::Generic's scalar is a template for methods that allow you to get and set individual scalar values.Thse definitions are then re-used and modified by various template subclasses. For example, the Template::Hash subclass supports blessed-hash objects, while the Template::Global subclass supports shared data; each of them includes an appropriate version of the scalar accessor template for those object types.Each template defines one or more behaviors, individual methods which can be installed in a calling package, and interfaces, which select from those behaviours and indicate the names to install the methods under.Each individual meta-method defined by a calling package requires a method name, and may optionally include other key-value parameters, which can control the operation of some meta-methods. Requirements: · Perl


Class::MakeMethods::Template Related Software