Yeay, another CPAN release: CGI::Prototype

merlyn on 2004-12-02T04:51:51

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 geekcruises.com 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.


Can you please...

Purdy on 2004-12-02T13:32:02

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.

Glad to have Merlyn's contribution

davebaker on 2004-12-02T19:34:40

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.

Re:Can you please...

ziggy on 2004-12-03T14:29:44

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. ;-)

Re:Can you please...

n1vux on 2005-08-15T14:45:01

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.

TIMTOWTDI.

Re:

Aristotle on 2004-12-02T15:50:36

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?