OpenFrame::WebApp::User::Factory - a factory for creating users


OpenFrame-WebApp documentation Contained in the OpenFrame-WebApp distribution.

Index


Code Index:

NAME

Top

OpenFrame::WebApp::User::Factory - a factory for creating users

SYNOPSIS

Top

  use OpenFrame::WebApp::User::Factory;

  my $ufactory = new OpenFrame::WebApp::User::Factory()->type('webapp');
  my $user     = $ufactory->new_user( @args );

DESCRIPTION

Top

The OpenFrame::WebApp::User::Factory class should be used to create user objects as needed.

This class inherits its interface from OpenFrame::WebApp::Factory. It uses OpenFrame::WebApp::User-types()> to resolve class names.

ADDITIONAL METHODS

Top

$new_user = $obj->new_user( ... )

creates a new user of the appropriate type. passes all arguments on to the users constructor.

AUTHOR

Top

Steve Purkis <spurkis@epn.nu>

COPYRIGHT

Top

SEE ALSO

Top

OpenFrame::WebApp::Factory, OpenFrame::WebApp::User


OpenFrame-WebApp documentation Contained in the OpenFrame-WebApp distribution.
package OpenFrame::WebApp::User::Factory;

use strict;
use warnings::register;

use OpenFrame::WebApp::User;

our $VERSION = (split(/ /, '$Revision: 1.3 $'))[1];

use base qw ( OpenFrame::WebApp::Factory );

sub get_types_class {
    my $self = shift;
    return OpenFrame::WebApp::User->types->{$self->type};
}

sub new_user {
    my $self = shift;
    return $self->new_object( @_ );
}

1;

__END__