Linux Journal: Building Sites with Mason
Jun 24, 2000, 14:50 (0 Talkback[s])
(Other stories by Reuven M. Lerner)
Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers
"Programmers willing to trade speed for portability have a
number of options at their disposal. Many Perl programmers have
chosen to use mod_perl, which makes it possible to modify Apache's
behavior using Perl modules. A Perl module invoked by mod_perl is
run inside the Apache process, removing the overhead associated
with starting a separate CGI process. mod_perl also caches the
compiled version of invoked modules, eliminating the need to
compile them each time they are run. The result is a dramatic
improvement in speed, as well as the flexibility to modify Apache
quickly and easily using Perl."
"When a site needs to create a large quantity of dynamic
output, much of which is written and designed by non-programmers,
mod_perl's power is hampered by the need to use dozens or
hundreds of modules, each servicing only a single URL or directory.
The solution to this problem is to integrate mod_perl with
templates, which intersperse HTML-formatted text with Perl code. We
have looked at templates on several previous occasions and have
seen their power and flexibility."
"This month, we will look at Mason, a mod_perl module
written by Jonathan Swartz, which attempts to solve many of these
problems. It uses templates to separate programming from
[HTML]. Furthermore, it encourages the use of separate
``components'', which can be built up to create a large,
dynamically generated site. Because these components exist in
separate files, Mason offers additional advantages:
- It caches components, providing a bigger speed boost than that
from simple templates.
- It provides a complete debugging and previewing
- It produces output files [...?]"