Hi,
I am using an open source product, in which version keep on changing. Sometimes even it framework. I have customized the product as per my needs. So as a new version comes up i have to rewrite my code in product.
Can anyone please suggest me how this rewriting some can be done...any migration strategy which work in such case.
Thanks
Swati
Best Code Migration technique
Moderator: General Moderators
There are two strategies I see used most often:
1) Create a diff (or patch) of your changes. Alter the product, then generate a diff by comparing your altered version to the original. When a new version of the product comes out apply your diff / patch to it.
This sometimes won't work if the product's code changes drastically. But then only the drastic changes need manual handling.
2) Many projects offer patches along with full downloads. You may be able to apply just the patches to your altered version of the project.
Generally, when I customize an open source project for my own use (in a way that no one else would be interested in), I don't ever upgrade. I only apply security patches.
1) Create a diff (or patch) of your changes. Alter the product, then generate a diff by comparing your altered version to the original. When a new version of the product comes out apply your diff / patch to it.
This sometimes won't work if the product's code changes drastically. But then only the drastic changes need manual handling.
2) Many projects offer patches along with full downloads. You may be able to apply just the patches to your altered version of the project.
Generally, when I customize an open source project for my own use (in a way that no one else would be interested in), I don't ever upgrade. I only apply security patches.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Re: Best Code Migration technique
Adapter or facade pattern may offer some assistance. Your situation is pretty undesirable. If you can get out of it then do. If you can't base your code on a solid API you're going to permanently "fixing" your code, no matter how good the mechanism for performing the update, you can expect yourself to end up bug-fixing difficult bugs on a regular basis. If you don't have a very good test suite you can expect said bugs to go unnoticed for some time as well.swati wrote:I am using an open source product, in which version keep on changing. Sometimes even it framework. I have customized the product as per my needs. So as a new version comes up i have to rewrite my code in product.
Can anyone please suggest me how this rewriting some can be done...any migration strategy which work in such case.
Ole's absolutely right. The best way to customize an open source project is by adding modules or at least leveraging its API. I only alter the original project as a last resort. And in fact I only choose open source projects to use for clients if the project offers a modular way to add custom code.
For example, I've used the Drupal CMS for a few projects. On all but one project I was able to do everything with custom modules and themes. So updates to Drupal were trivial and had no adverse affects on my overall project. One particular project, however, has required us to alter some core Drupal functionality, so we chose to lock into the version of Drupal we started with except for security update patches. Every update is a tedious mess to handle and often introduces new bugs. This is through no fault of the open source project, just interference with how we customized it.
For example, I've used the Drupal CMS for a few projects. On all but one project I was able to do everything with custom modules and themes. So updates to Drupal were trivial and had no adverse affects on my overall project. One particular project, however, has required us to alter some core Drupal functionality, so we chose to lock into the version of Drupal we started with except for security update patches. Every update is a tedious mess to handle and often introduces new bugs. This is through no fault of the open source project, just interference with how we customized it.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA