Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi All

I need the wealth of your wisdom and experience in software development, so this is not related to Perl per se. Hence 'OT' in the subject. The software that I've been working on for the past 2.5 years has become so hard to optimise and modified. We had a meeting last week and we decided to re-architect it.

The basic problem is that the software is written as one monolithic mod_perl application, which appears to be three different products to the client. To be able to go forward, we need to do deep surgery on it and split it to different independent sub-systems and layers. We also need to majorly change the database structure. Although we might be able to reuse the existing modules, I am sure that the new architecture will be completely different from now.

This brings me to question, "HOW are we gonna do it?" There are two options: First is to Rewrite, and second is to Refactor. I'll list the good and the bad of each approach from my point of view. Then I'd like to hear what y'all have experienced when facing problems like this.

Rewrite

My definition of Rewrite is to create the new architecture and then copy the relevant modules from the old code base with probably some modifications to fit the module with the new architecture. So this is not a complete rewrite, but this is not a refactoring either.

The good

  • We can start from a clean state, which doesn't carry baggages from the old architecture.

The bad

  • We may miss some functionalities from the old system while porting the modules.
  • The old code base could have been changed while we're working on the new code, which makes a porting nightmare.
  • The new code base isn't tested to handle the load of the production code, which mean we'll have performance problem on the first few months after launching the new code.

Refactor

My definition of Refactor is to change the code one thing at a time, whithout affecting functionality.

The good

  • Less likely to miss functionalities from the old code base.
  • The original code has already been tested on production.

The bad

  • We might not end up with the new ideal architecture, because refactoring works on the code level, not on architectural level.

I haven't made up my mind on either approach. And due to my limited experience, I can't get a more exhaustive list of the good and the bad of them. Can you help?

Thank you

UPDATE: Thanks for everyone who've provided their insights. More insights are welcome. Up to this minute the best insight is from GrandFather, which suggested to refactor by creating interfaces and test suites.

UPDATE: Strangler Application pointed by adrianh seems to be the technique that incorporate interfaces mentioned by GrandFather. Great suggestions guys!!! Keep it coming.

-cheepy-

In reply to OT: Rewrite or Refactor? by badaiaqrandista

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found