[clug] Higher level CGI frameworks?

Sam Couter sam at couter.id.au
Tue Apr 24 10:30:21 GMT 2007

Michael James <clug2 at james.st> wrote:
> On a LAMPerl, LAMPython, or LAMJava platform
>  what is a better web app development framework than CGI?

Throw away the M and use PostgreSQL instead.

> In the bad old days, I wrote simple web apps in Perl CGI.

Everybody did. Thankfully the world has moved on (mostly).

> Ended up with some ugly un-maintainable mazes that still haunt me.

[ ... ]

> I'm not learning PHP; "Trainer wheels without the bicycle" doesn't appeal.

PHP bad. Very bad. Unless you want more un-maintainable mazes to haunt
you in the future.

> Mason sounded good, except I couldn't get it installed on SLES9
>  and scope among the fragments turned into a nightmare.

I was going to suggest Mason, simply because it's the only Perl-based web
templating language I know of. So I'll stop there.

In the Python world, there's Zope and the products based on it such as
Plone. They're fairly heavyweight in terms of application infrastructure
and the learning you'll have to do to use them, but they're very
flexible and powerful.

Still Python, there's also Twisted and the templating language it uses, I
think it's called Nevow these days (from woven, the previous version,
spelled backwards).

> Java servelets, that's what the boss wants.
> Is it just back to the horror of CGI in an unfamiliar language?

Don't do Java servlets. I'm a professional Java programmer and I love
the language and platform, but servlets are as you say just another way
to do CGI. Java has so much more to offer than that. A list off the top
of my head, in no particular order because I don't know your precise
requirements: Java Server Pages (JSP), Java Server Faces (JSF), Facelets,
Tapestry, Seam, JBoss Portal, Struts + Tiles.

Note that the Java solutions are also fairly heavyweight, requiring an
application server such as JBoss or Tomcat to deploy to.

> Any comments, suggestions more constructive than Holy Writ?

Whatever you decide to go with, make sure it at minimum keeps a clear
separation between the view and the model/controller parts of MVC.
That's where CGI and PHP usually goes wrong, and why using a templating
language instead of executable code for the presentation layer is a good

Keeping the model and controller separated is nice but not so critical
as both those parts are just code. The view shouldn't have code in it.

I also find it much easier to develop using event-oriented component
based toolkits like Seam and Tapestry rather than action-oriented
explicit HTML-based tools like Struts or bare JSP. It makes development
a bit more like creating a GUI application and less like weaving magic
strings together in arcane ways to produce a mixture of HTML, URLs and
GET parameter values.
Sam Couter         |  mailto:sam at couter.id.au
                   |  jabber:sam at teknohaus.dyndns.org
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20070424/ed7c0ddb/attachment.bin

More information about the linux mailing list