Sandboxing class modules with instances of a CGI script
mark at rawcane.net
Wed Jan 30 10:45:30 GMT 2008
>> If I am going to tidy up my code by splitting things up into class
>> then I am in a dilemma as to whether to have lots of different versions
>> the modules or whether to centralise my class code and risk breaking
>> something somewhere that I may not pick easily be able to pick up on
>> whenever I update the modules. If I go for the former do I just put the
>> modules next to the CGI script somewhere in the site directory structure
>> is there a tidy way to have multiple versions in my lib path and require
>> specific version from each CGI instance?
> As Andy said a single set of installed modules with the best test suite
> you can come up with is the way to go. Having multiple copies of
> supposedly similar code is at best a management nightmare and is
> guaranteed to help proliferate bugs rather than avoid them.
> If you find that you need slightly different things in different
> implementations of the application then structure your design so that
> you have the core common functionality in classes that are easily
> sub-classable where necessary.
Ok - that makes good sense and solves the problem of quickly having to
deploy sites with new functionality without the risk. Cheers for the advice.
More information about the london.pm