Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Why CGI::Application?

by derby (Abbot)
on Jan 13, 2004 at 13:32 UTC ( #320948=note: print w/replies, xml ) Need Help??

in reply to Why CGI::Application?

It seems as though all of the benefits of C::A are things that can be accomplished by simply adjusting your coding style; making more blocks of code into subroutines, etc.

Sure that will work.

Hey but wait, darnit, I want to use CGI::Simple instead of CGI ... better write that hook.

Hey but wait, darnit, I want to do some post-processing after the HTML is sent to the client ... better write that hook.

Hey but wait, darnit, I need to get into the process after reading the HTTP stream but before I do my real app stuff ... better write that hook.

Hey but wait, darnit, I need a hook after generating content but before sending the headers ... better write that hook.

Hey but wait, darnit, I need a hook to modify the headers ...

Hey but wait, darnit, I need a hook to override what step is being executed ...

Hey but wait ...

CGI::Application gives all this to me and it's been developed, reviewed and used by a slew of talented and qualified people. You see the authors have given you a framework that makes the easy things easy and the hard things possible. Sure you could do that yourself, but you could also write yourself or for that matter your own interpreter.

To me, CGI::Application did not add a layer of complexity and confusion but actually cleared up a lot of issues when trying to build MVC apps. I always knew templates were the VIEW and application specific modules were the MODEL ... it was that damn CONTROLLER that became a big hairy beast ... well CGI::Application really cleaned up my thought process when it came to MVC. So sure I could have spent weeks, months, years creating my own Application framework ... one that's easy to use for the straightforward cases but also allows me to hook in and change things on the fly or I could spend 15 minutes downloading CGI::Application.

So I say well done Jesse (and all the contributors).


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://320948]
and a moth chases the moon...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2018-06-22 02:46 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (121 votes). Check out past polls.