In his talk “Modernisation of Software“, Georg Pietrek of itemis AG shows the key points when you need to modernize software (= make large, disruptive changes). Karsten Thoms then demonstrated those points in a practical example in his talk “Model based migration of Oracle Forms applications”.
- Analyze the old code
- Create DSLs that describe the pieces of the old code which you want to migrate
- Write a small demo what the new app should look like
- Develop code generators which take the DSLs to generate the demo
After you have proven that you have covered all important bases this way, you can expand the DSLs (or rather write more code using the DSLs) to migrate the rest of the old code. You can reuse the small demo from step #3 to test any changes to the DSLs and code generators on a small code base.
The big advantage of using models to modernize is that manual migration often runs into a death spiral: Developers start with little knowledge (especially, when the original developers aren’t around anymore). They learn as they migrate code. But as this process advances, it becomes more and more expensive to fix early mistakes. With the model driven approach, you fix the bug in the code generator and thousands of lines of code are corrected at the push of a button. This means you can make abstraction work in your favor.
The advantage over exiting tools to migrate an old code base is that the model based approach is more flexible.
A quote from the talk: “Software doesn’t rot but it’s environment changes.” Eventually, the software no longer meets the needs.