Mobile convergence it’s nice because there’s so much of it!
I took part in Charles Weir’s Supporting Many Platforms session at the ACCU conference (URL) yesterday.
Charles heads up Penrillian, a company specialising in porting applications between mobile platforms and between different implementation languages.
The first question was why port? why not just start again from scratch? The answer is that rewriting from scratch is in most cases very expensive, it’s almost impossible to reimplement from a specification (or rather to rewrite the specification from what you’ve implemented). Furthermore, while you’re rewriting you’re not advancing and so you lose time in which other software may be moving forward in the marketplace. (Internet Explorer overtook Netscape while Netscape was being rewritten.) In a Software Product Line setting you have to produce so many product variants that it’s simply not practical to rewrite from scratch each time.
Charles presented three key techniques to perform the porting process:
Code Triage - Begin by dividing the codebase to be ported into portable code, potentially portable code (which would be portable if it was refactored) and platform-specific code (examples of this are typically found where the code talks to the outside world e.g. device hardware, networks, UIs etc.). Charles also noted that this triage process implies some architectural decisions to minimize the size of the non-portable code.
Refactoring to produce portable code - Much code could be portable if it was refactored “ business logic and rendering code are prime examples. Typical issues Penrillian have encountered include UI event handlers that do business logic, rendering code for a fixed-size screen, communication interfaces that aren’t abstracted.
Test-driven porting - Changing code introduces bugs and so you need a safety net. The process used at Penrillian starts by ensuring that the code is under test on the original platform. When this has been achieved logging is used to record calls and responses at the points where the program calls non-portable code. This logging data is then used to generate mock objects (URL) to mock-out code for your new platform. Once you have this in place you can begin your reimplementation of platform-specific code safe in the knowledge that your safety harness will catch any problems in your new implementation.
Charles concluded by noting the two worst mistakes when porting:
- Thinking something isn’t needed when you port - it usually will be.
- Not using testing to support your construction process.
At the end of the talk I asked everyone what his or her thoughts were on device convergence in the mobile space. I’ve participated in a few of the sessions run by Cambridge Wireless’s Mobile Games group and these always seem to end with the hope for greater convergence in the device space. As I’ve previously noted, 50% of the development budget for a mobile game can be consumed by porting costs.
The first observation was that convergence is nice because there’s so much of it. More seriously it was also observed that vendor lock-in relies on divergence and it’s my own view that the pressures operating in this market will force continued fragmentation in device platforms and capabilities. The forces for convergence are simply not strong enough yet.
Penrillian has a number of links to mobile porting resources on their web site at http://www.penrillian.com/porting.

