DesignPattern::Factory::Creator - a participant in the Perl implementation of the Factory Method.
DesignPattern::Factory::Creator is the superclass of DesignPattern::Factory::ConcreteCreator. That is, ConcreteCreator inherits all methods from Creator, but can override these methods by implementing its own methods.
From GOF, the DesignPattern::Factory::Creator class:
- declares the factory method, which returns an object of type DesignPattern::Factory::Product. DesignPattern::Factory::Creator may also define a default implementation of the factory method that returns a default DesignPattern::Factory::ConcreteProduct object.
- may call the factory method to create a Product object.
Constructor for this class. Usage:
my $object = DesignPattern::Factory::Pattern->new();
The default FactoryMethod just dies with an error, thus ensuring that all subclasses implement a working version of this method.
Calls FactoryMethod() and stores the result.
Nigel Wetters (nwetters@cpan.org)
Copyright (c) 2001, Nigel Wetters. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install DesignPattern::Factory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DesignPattern::Factory
CPAN shell
perl -MCPAN -e shell install DesignPattern::Factory
For more information on module installation, please visit the detailed CPAN module installation guide.