in reply to All-in-one script vs independent scripts
It is being re-written for v6.0 now. At the moment we also have a new web-app in hand. So we are doing both of these jobs using CGI::Application, HTML::Template, Data::FormValidate, CGI::Application::ValidateRM and CGI::Session as the basis of our framework. We have wrapped CGI::A so as to provide us with common methods for validation and session management. A separate module provides a wrapper around Class::DBI to provide SOME of our DB access, even Class::DBI and all its friends cannot give us all we need so we have another module that provides a variety of methods to handle other DB access which we may port to Class::DBI as we develop more internal skills.
Now we have the best code re-use we have ever had. All our modules and their various methods are far better documented than ever before and we are outputting code at about three times the rate we experienced in the past. v5.11.0 of the monster was still classic CGI style app running under mod_perl, it had 87,510 lines of code. A feature enhanced CGI::A version with approximately 350 HTML tempaltes, 125 run_modes and all our helper modules totals 12,500 lines of Perl (add tempaltes to that of course for total job size) and we have an app that we can dynamically skin for appearance and already maintenance is proving to be a dream - at least during the debugging phase.
My story? Years of bitter experience teaches me I should have learned OO Perl years ago! Modules and Packages are the way to go! Break it up into little bits, debug and test well, then reuse them wherever you can!
|
|---|