The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Class::MakeMethods::Template::ReadMe - About this Module

SYNOPSIS

  package MyObject;
  use Class::MakeMethods::Template::Hash (
    'new'       => 'new',
    'string'    => 'foo',
    'number'    => 'bar',
  );
  
  package main;   
 
  my $obj = MyObject->new( foo => "Foozle", bar => 23 );
  print $obj->foo();
  $obj->bar(42);

DESCRIPTION

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

Prerequisites

Requires Class::MakeMethods 1.003.

Tested Platforms

This release has been tested succesfully on the following platforms:

  5.6.1 on darwin

You may also review the current test results from CPAN-Testers:

  http://testers.cpan.org/search?request=dist&dist=Class-MakeMethods

VERSION

This is version 1.004 of Class::MakeMethods::Template.

INSTALLATION

You should be able to install this module using the CPAN shell interface:

  perl -MCPAN -e 'install Class::MakeMethods::Template'

If this module has not yet been posted to your local CPAN mirror, you may also retrieve the current distribution from the below address and follow the normal "gunzip", "tar xf", "cd", "perl Makefile.PL && make test && sudo make install" procedure or your local equivalent:

  http://www.evoscript.org/Class-MakeMethods/

SEE ALSO

See Class::MakeMethods for an overview of the framework this fits into, and the general calling conventions for use and make.

See Class::MakeMethods::Template for discussion of the code generation features.

If you have used Class::MethodMaker, you will note numerous similarities. Backward compatibility and conversion documentation is provded in Class::MakeMethods::Emulator::MethodMaker, available in a separate distribution on CPAN.

CREDITS AND COPYRIGHT

Developed By

  M. Simon Cavalletto, simonm@cavalletto.org
  Evolution Softworks, www.evoscript.org

Source Material

Inspiration, cool tricks, and blocks of useful code for this module were extracted from the following CPAN modules:

  Class::MethodMaker, by Peter Seibel.

Feedback and Suggestions

Thanks to:

  Martyn J. Pearce
  Scott R. Godin
  Ron Savage
  Jay Lawrence
  Adam Spiers
  Terrence Brannon

Copyright 2002 Matthew Simon Cavalletto.

Portions copyright 1998, 1999, 2000, 2001 Evolution Online Systems, Inc.

Portions copyright 1996 Organic Online.

Portions copyright 2000 Martyn J. Pearce.

License

You may use, modify, and distribute this software under the same terms as Perl.