DesignPattern::Factory::Creator - a participant in the Perl implementation of the Factory Method.


DesignPattern-Factory documentation  | view source Contained in the DesignPattern-Factory distribution.

Index


DESCRIPTION

Top

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.

new()

Constructor for this class. Usage:

  my $object = DesignPattern::Factory::Pattern->new();

FactoryMethod()

The default FactoryMethod just dies with an error, thus ensuring that all subclasses implement a working version of this method.

AnOperation()

Calls FactoryMethod() and stores the result.

AUTHOR

Top

Nigel Wetters (nwetters@cpan.org)

COPYRIGHT

Top


DesignPattern-Factory documentation  | view source Contained in the DesignPattern-Factory distribution.