in reply to Three-layer web application architecture

Perrin must not be awake yet :). Anyway, I am sure that as this thread evolves, there will be references to his article: Building a Large-scale E-commerce Site with Apache and mod_perl so I provide the reference now

CGI::Application rocks the house

  • Comment on Building a Large-scale E-commerce Site with Apache and mod_perl

Replies are listed 'Best First'.
Re: Building a Large-scale E-commerce Site with Apache and mod_perl
by perrin (Chancellor) on Nov 17, 2003 at 18:00 UTC
    The architecture described there is different from what pg seems to be talking about. My interpretation is that pg is splitting the model into data objects and actions that use them, with a thin control layer that maps web requests to actions. That's how Struts works. When we designed the eToys site, we didn't think that was a very valuable distinction, so we had all of the "action" logic inside of mod_perl handlers that were also controllers.

    The downside of how we did it is that you would not have been able to call one of those actions from a cron job or other command-line script in any easy way, although you could certainly call the data objects. In a project I just finished working on, we used CGI::Application, and it is possible to use CGI::Application run-modes as "action" objects to some degree. They can be called from test scripts fairly easilly, although you have to pass your params through a CGI object.