Class::Factory::Enhanced - More functionality for Class::Factory


Class-Factory-Enhanced documentation  | view source Contained in the Class-Factory-Enhanced distribution.

Index


NAME

Top

Class::Factory::Enhanced - More functionality for Class::Factory

VERSION

Top

version 1.101420

SYNOPSIS

Top

    package My::Factory;
    use base 'Class::Factory::Enhanced';

    package Some::Class;
    My::Factory->add_factory_type(
        person_name    => 'Person::Name',
        person_address => 'Person::Address'
    );

DESCRIPTION

Top

This class subclasses Class::Factory and adds some functionality.

METHODS

Top

add_factory_type

Like Class::Factory's add_factory_type(), but this one can add several mappings at once. See the Synopsis for an example.

register_factory_type

Like Class::Factory's register_factory_type(), but this one can add several mappings at once.

make_object_for_type

    $factory->make_object_for_type('person_name',
        last_name  => 'Shindou',
        first_name => 'Hikaru',
    );

An alternative constructor that gets the class to be constructed from the factory, then calls new() on that class.

Takes as arguments the object type to be constructed and a list of arguments to be passed to the constructor (new()) of the newly constructed object.

INSTALLATION

Top

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Class-Factory-Enhanced.

AVAILABILITY

Top

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Class-Factory-Enhanced/.

The development version lives at http://github.com/hanekomu/Class-Factory-Enhanced/. Instead of sending patches, please fork this project using the standard git and github infrastructure.

AUTHOR

Top

  Marcel Gruenauer <marcel@cpan.org>

COPYRIGHT AND LICENSE

Top


Class-Factory-Enhanced documentation  | view source Contained in the Class-Factory-Enhanced distribution.