Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Rewriting a large code base

by BMaximus (Chaplain)
on Jun 28, 2001 at 04:33 UTC ( [id://92137]=note: print w/replies, xml ) Need Help??


in reply to Rewriting a large code base

This reminds me of my last job. The original code was a huge big lump of code. Most of it was in one module and it was a MESS. So my coworkers and I were given the task to turn the mess into what was to be known as 2nd gen. It too had extensive HERE docs. So here's what we did.

We had made a decision to extract all HERE docs and template the entire site. It was in our belief that HTML does not belong in Perl code. It only serves to bloat it. We then documented as to where everything went as far as the layout of the application. Inputs, outputs, database access, etc etc. It was a complete rewrite while basicaly salvaging code where we could.

We split the site up in to different elements.

  • Application
  • Business Logic
  • Database interface
  • Utilities
  • Initialization
  • Miscellaneous


Each of these were organized in to a separate directory and cvs was used to coordinate each of our tasks and contributions.

Application: was where the main applications were put it took care of presenting the information to the user.

Business Logic: took care of any calculations that wre needed and also subroutines for things that were commonly accessed were here as well so as to keep things from becoming redundant.

Database Interface: self explanatory. It held all the routines that put and retrieved data from the database.

Utilities: held modules with subroutines for calculating dates or implementing encryption.

Initialization: held startup.pl for mod_perl

Miscellaneous: Things we needed but couldn't really put in to a catagory.

Doing this and of course commenting and commenting some more made it very easy to maintain and change.

We created standards as to what subroutines would output. For instance any subroutine that needed to output a hash or an array would always give a ref of that type.

For the most part the theme was break it down and simplify. Which seemed to work really well for us. So breaking things up in to separate elements may work for you and it seems like your headed in that direction.

BMaximus

Update: I hope if your putting in "overtime" and staying in late to do this for your company that once its finished, they do something for you to show their appreciation for you and your coworkers. One of the best things about where I worked was they they did show us how much we meant to the company.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://92137]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-03-19 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found