AI::ExpertSystem::Advanced::Viewer::Factory - Viewer factory


AI-ExpertSystem-Advanced documentation Contained in the AI-ExpertSystem-Advanced distribution.

Index


Code Index:

NAME

Top

AI::ExpertSystem::Advanced::Viewer::Factory - Viewer factory

DESCRIPTION

Top

Uses the factory pattern to create viewer instances. The viewer instances are useful (and required) to show data to the user.

AUTHOR

Top

Pablo Fischer (pablo@pablo.com.mx).

COPYRIGHT

Top


AI-ExpertSystem-Advanced documentation Contained in the AI-ExpertSystem-Advanced distribution.
#
# AI::ExpertSystem::Advanced::Viewer::Factory
#
# Author(s): Pablo Fischer (pfischer@cpan.org)
# Created: 11/29/2009 19:12:25 PST 19:12:25
package AI::ExpertSystem::Advanced::Viewer::Factory;

use strict;
use warnings;
use Class::Factory;
use base qw(Class::Factory);

our $VERSION = '0.01';

sub new {
    my ($pkg, $type, @params) = @_;
    my $class = $pkg->get_factory_class($type);
    return undef unless ($class);
    my $self = "$class"->new(@params);
    return $self;
}

__PACKAGE__->register_factory_type(terminal =>
        'AI::ExpertSystem::Advanced::Viewer::Terminal');

1;