jump to navigation

Source code nightmares July 13, 2007

Posted by Phill in General J2EE.
trackback

There’s a legacy application I have to deal with from time to time. It was originally written in 2001 (give or take a year or two). It’s J2EE based, but instead of using a framework like Struts, it uses a custom framework written specifically for the application (alarm bells sounding already!). Anyway, it’s a pretty horrible application to maintain – but that’s by the by.

The source code for the application was originally stored in Microsoft Visual SourceSafe… not great! Last year, a group of enhancements were requested for the project – for example, some of the pages needed a new design, a few bits of functionality needed to change… these were all implemented as separate projects.

In order to accomplish this, the code was moved over to Subversion and branches created for each project. Except that, it seems some of the branches were created directly from SourceSafe, some of them were created from other branches in Subversion… in other words, it’s a mess! What should have happened is that the code was created in the trunk, and then branches all created from the trunk. Now, it’s actually difficult to know which version of the code is the ‘right’ version, or if in fact there is a ‘right’ version!

The moral of this story?

  • Always use a decent version-control system.
  • Structure it logically, and don’t be afraid to refactor it if it starts getting out of hand.
  • If possible, merge the branches and trunk regularly and perform regression testing

You’ll save yourselves a whole world of pain if you do…

And I will try and get something which is actually useful up here soon!

Advertisements

Comments

1. M.Liang Liu - October 13, 2007

“Always use a decent version-control system.”…yup,its a basic moral of java programming.


Sorry comments are closed for this entry

%d bloggers like this: