On Sunday, June 16, 2002, at 07:02 AM, Eric Frazier wrote:

> The big points I want to achieve right now, is to make everything I 
> write
> OOP,  separate HTML from code as much as possible, and to not make it
> impossible to deal with for the people I work with who don't know as 
> much
> perl as I do.

One thing that has proven immensely beneficial on the project that I'm 
working on now, which is very similar to yours in that it's a complete 
redo intended to be 'right', is this: Write each page's functionality in 
a package that is 100% removed, interface-wise, from HTML, then 'glue' 
that module to HTML (via HTML::Template for output and CGI.pm for input) 
in a module name identical to, but preceded by Apache::

So, we have a page module like:

Functionality in CompanyName::page1, and glue code in 
Companyname::Apache::page1

Modules NOT under the CompanyName:: namespace cannot be dependent IN ANY 
WAY on mod_perl, but must be mod_perl clean, of course.

This makes the module functionality very easy to test WITHOUT firing up 
Apache. We have a complete white box test suite that tests at the Perl 
level, and complete black box test suite that tests at the HTTP level.

This proved a good strategy when we decided to implement a SOAP 
interface to some of our functionality. We made some new glue code in 
CompanyName::SOAP::page1 that was based on SOAP::Lite and it was just as 
easy as it should be, with 100% code reuse.

--
-- Tom Mornini
-- InfoMania Printing and Prepress
--
-- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini

Reply via email to