Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

See my home page [].

Journal of merlyn (47)

Wednesday December 01, 2004
11:51 PM

Yeay, another CPAN release: CGI::Prototype

[ #22099 ]
After much gnashing of teeth, and getting copyright permission, I've now added CGI::Prototype to my CPAN releases. This is the module alluded to by my column on using Class::Prototyped for "classless classes".

This module provides a very generic, very flexible framework for web applications, encouraging a good MVC design by putting light or heavyweight classes in charge of the Controller, Template Toolkit in charge of the View, and your favorite swizzler (mine is Class::DBI) as the Model. I'm using this package for a Very Large University on two separate projects, and I'm told they may be settling on this architecture for many future web apps. I'm also using this for for their entire online booking and admin application. I find that this architecture captures the essence of a web app in a nice way.

The examples are a bit scarce... I hope to get a new release out within a few weeks that has a completed app as an example. Also, I'm looking for help to create other subclasses for common session management, and so on.

I'm hoping that this framework is generic enough that a Maypole-like structure can be built on top, thereby scaling and integrating nicely with other apps.

Feedback welcome.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • elaborate on why we need another CGI framework? I use (and love) CGI::Application [], which already has built-in support for HTML::Template and plugin support for Template, Session Management, Input Validation, etc. There's also a lively community around those modules already and the module authors are happy to receive patches and/or other contributions for improvements.
    • Even if the new module shares some features with CGI::Application, I am very glad to have more publicly released code from Merlyn to review and learn from.
    • Answer #1: Why not?
      Answer #2: TMTOWTDI
      Answer #3: If you haven't written a CGI framework or a Templating system in Perl this month, can you really call yourself a Perl programmer?

      Choose any three. ;-)

    • Randal's explication of the Why of this module is serialized in his Linux Magazine May-July, 2005 column #70 [] and #71 [] and #72 [] as motivated, worked example(s).

      My summary -

      CGI::Prototype offers a different way of factoring out the "you always had to write this glue code" code. Catalyst uses the Perl Attributes annotations to factor out glue-code, which is classy demonstration that attributes are a good idea. CGI::Prototype uses prototypical (instance-based, or nonce-class, or "Frame-Slot") inheritance.

      # I had a sig when sigs were cool
      use Sig;
  • I wonder about the same question as Purdy.

    Also, a somewhat offtopic request: could you add RSS (or preferrably Atom) feeds to your columns pages?