OpenPlugin::Application 0.11 review

Download
by rbytes.net on

OpenPlugin::Application is a subclass of CGI::Application, meant to help you create reusable web applications. SYNOPSIS # Exam

License: Perl Artistic License
File size: 76K
Developer: Eric Andreychek
0 stars award from rbytes.net

OpenPlugin::Application is a subclass of CGI::Application, meant to help you create reusable web applications.

SYNOPSIS

# Example from OpenThought's Demo.pm

package Demo;
use base "OpenPlugin::Application";
sub setup {
my $self = shift;
$self->run_modes(
'mode1' => 'init_demo',
'mode2' => 'get_os_list',
'mode3' => 'get_os_info',
);
$self->start_mode( 'mode1' );
$self->mode_param('run_mode');
}
sub init_demo { ... }
sub get_os_list { ... }
sub get_os_info { ... }
1;

# Example from OpenThought's demo.pl

#!/usr/bin/perl -wT
use strict;
my $r = shift;
my $demo = Demo->new( PARAMS => {
config => { src => "/path/to/OpenPlugin.conf" },
request => { apache => $r },
});

$demo->run();

OpenPlugin::Application is built on Jesse Erlbaum's popular CGI::Application module. OpenPlugin::Application is simply a subclass of CGI::Application. Jesse says the following about CGI::Application:

"CGI::Application is intended to make it easier to create sophisticated, reusable web-based applications. This module implements a methodology which, if followed, will make your web software easier to design, easier to document, easier to write, and easier to evolve."

How does it do this? Jesse goes on to say:

"The guiding philosophy behind CGI::Application is that a web-based application can be organized into a specific set of "Run-Modes." Each Run-Mode is roughly analogous to a single screen (a form, some output, etc.). All the Run-Modes are managed by a single "Application Module" which is a Perl module. In your web server's document space there is an "Instance Script" which is called by the web server"

The biggest difference between CGI::Application and OpenPlugin::Application is that query object they both use; one is designed to use CGI.pm, the other OpenPlugin. Generally speaking, everything in the still applies. Any differences will be noted in this document.
It is not necessary to use OpenPlugin::Application in order to build web applications using OpenPlugin. This plugin is meant to be for your convenience -- to help you structure your web applications in a manner which makes sense, and is reusable.

Requirements:
Perl

OpenPlugin::Application 0.11 search tags