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


DesignPattern-Factory documentation Contained in the DesignPattern-Factory distribution.

Index


Code Index:

NAME

Top

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

DESCRIPTION

Top

DesignPattern::Factory::ConcreteCreator overrides the factory method it inherits from DesignPattern::Factory::Creator to return an instance of a ConcreteProduct.

FactoryMethod()

Returns a new ConcreteProduct.

AUTHOR

Top

Nigel Wetters (nwetters@cpan.org)

COPYRIGHT

Top


DesignPattern-Factory documentation Contained in the DesignPattern-Factory distribution.

package DesignPattern::Factory::ConcreteCreator;
$VERSION = '0.01';
use strict;
use Carp; # nice errors
use vars qw( $VERSION @ISA );
use DesignPattern::Factory::Creator;
@ISA = qw ( DesignPattern::Factory::Creator );

sub FactoryMethod
{
    use DesignPattern::Factory::ConcreteProduct;
    return DesignPattern::Factory::ConcreteProduct->new;
}

1;