Martin Fowler coins the term StranglerApplication to describe one approach to rewriting an important application. You slowly introduce rewritten code in with the existing code until one happy deployment months (or years!) later you realize: you're no longer using the old code. The new code has strangled the old code like Australian strangler vines. Some of the huge benefits include:
- no long periods of “down time“ while an enormous migration takes place
- gentle introduction of new/modified features so no mass user retraining is required
- the developers can start simple and gradually, as their understanding of the application grows, take on tougher tasks
I've found this metaphor very useful and we've successfully “strangled” and “are strangling” applications for . . . let me count . . . 3 major customers at the moment. In our business we're often confronted with a customer who has invested a lot in a functioning program but needs it to do more. Usually, that more can be accomplished easier with .Net, and we present a compelling case for it.
One downside with this approach is your technical team may need to get down and dirty with the existing code base. It's not glamourous, but weeding through the application code that you intend to strangle is a must if you're going to interoperate and really pull this off. We've made use of guides such as these to help get up to speed on Cold Fusion and PHP:
For the record, I'm not in favor of just rewriting an application so it's in a programming flavor (language) you prefer. C'mon! Slight modifications may not warrant a strangler approach. Larger feature additions, however, and full rewrites are strong candidates especially when you can user Web Services, ADO.Net, and all that .Net has to offer.
I've been doing a lot of strangling lately on a ColdFusion application. I had never done much with ColdFusion before this, so it's been eye opening. I rolled my eyes when this first came across my desk: oh God, I thought to myself, this is going to suck. It's turned out to be quite different. I can see the appeal of CF: it's very simple and easy to learn. I can also see where Microsoft and .Net might have borrowed from ColdFusion (with the ASP.Net template tag approach and databinding in general). I still don't consider myself a ColdFusion expert by any stretch, but I am turning in to a pretty darn good ColdFusion strangler.
Came across an oldie but goodie from Sam Gentile's blog: It's the Runtime Stupid. It's a departure from the old days where VB folks didn't play nice with C++ folks, etc. As Gentile writes:
Now, here's the drill. Forget about learning C#. Forget about learning VB.NET. Learn about the CLR and the BCL FIRST. That's the real .NET. The languages are just syntactic sugar.
I've been thinking about this again lately as I start to tackle a few projects with VB.Net folks. I'm sure the code base will be in VB.Net and it just isn't that big a deal. Newer .Net developers always seem to get hung up about VB.Net or C#.
Taking things a step further, I'm on a project where the customer has requested VB.Net source code, but the app is built on top of our company's framework which is all C#. Mind blowing? Hardly. It happens all the time. We can just reference the framework assemblies written in C# from the VB.Net tier, and off we go. If the customer has bought the whole framework source (not sure on this part), we can run the c# components through a conversion tool and we'll have VB.Net.
It's all MSIL (Microsoft Intermediate Language) in the end anyway!