Class::Factory - Base class for dynamic factory classes ========================== package My::Factory; use strict; use base qw( Class::Factory ); # Add our default types My::Factory->add_factory_type( perl => 'My::Factory::Perl' ); My::Factory->add_factory_type( blech => 'My::Factory::Blech' ); # Register optional types My::Factory->register_factory_type( java => 'My::Factory::Java' ); 1; # Create new objects using the default types my $perl_item = My::Factory->new( 'perl', foo => 'bar' ); my $blech_item = My::Factory->new( 'blech', foo => 'baz' ); # Create new object using the optional type; this library is loaded # on the first use my $java_item = My::Factory->new( 'java', foo => 'quux' ); # Adding a new factory type in code My::Factory->add_factory_type( custom => 'Other::Custom::Class' ); my $custom_object = My::Factory->new( 'custom', this => 'that' ); # Register a new factory type in code My::Factory->register_factory_type( bleededge => 'Other::Customized::Class' ); my $edgy_object = My::Factory->new( 'bleededge', this => 'that' ); See POD for details INSTALLATION To install this module perform the typical four-part Perl salute: perl Makefile.PL make make test make install DEPENDENCIES None, although this module was written almost entirely under the influence of Weezer. SIDE-EFFECTS May include headache, insomnia, and growth spurts, although a control group given English toffees in place had the same effects. COPYRIGHT AND LICENCE Copyright (c) 2002 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHORS Chris Winters * Eric Andreychek also helped out with code, testing and good advice.