Cross-Platform Mobile Development - #1
Posted by
JORRIT WIT on Thu, Jan 05, 2012 @ 11:53 AM
Cross-Platform Mobile Development
Best Practices in User-centric, Agile Design for the Cloud
Post 1 of an ongoing series
Written by Pablo Elustondo

2012 is just starting and some of our new customers are asking for user-centric, cloud-based business applications that run mobile and web platforms and to be developed in an Agile, flexible and scalable manner. The initial hype of the mobile application development market from 2010 is transitioning to a more mature business practice, revolutionizing the way we interact with computers, according to Gartner. Those of us who build business applications are very happy because this is enabling us to create much more usable applications at the same price as before or less.
These changes require some fresh thinking and we need to re-learn some of our techniques and concepts. Gone are the days when we could develop a web application using some server pages technology that every page clicked refreshed the browser and every time a customer asks for a new feature we have to re-do our pages. Technologies like NET webforms, or the venerable Java J2EE from the pre-mobile era are just not adequate any more. Also, trying to complement those technologies by adding interactivity using Flash or Silverlight or Java on the client is outdated, even non-viable in certain platforms.
Also, unless you are a really big software shop, you cannot afford to have and to maintain various different versions of the application, one for the web, another for iPhone, another for Android, another for other platforms.
Building on this, we will attempt to answer these issues as the subject of this blog series. We will target the following 7 design & development ideas:
- 1. Develop the core business engine of your application as a set of web services preferably implemented on a good ‘platform as a service’ (PaaS) layer that can easily be scaled up and re-uses exiting features. Two possible paradigmatic options are Google App Engine or Microsoft Azure. It is possible to develop those services with conventional server technology and deploy to an IaaS provider. We previously discussed the pros and cons of these choices in our white paper on cloud. Although some programming languages are slightly better than others, the choice of programming language is almost irrelevant. Java, C#, Python, etc, even javascript on the server could be used. Best practices produce a clean and generic API that can later be used by rich web clients or mobile apps. This service API produces a clear separation that can be tested automatically. Unless you find reasons for other web service protocols, use REST over JSON. XML is also possible but more complex and inefficient for doing highly interactive rich Internet applications.
- 2. Use a powerful and clean modern JavaScript framework to build both web pages and the core aspects of our mobile apps. There are various frameworks like jQuery, Dojo and Sencha (ExtJs). We will compare some of these options in future posts. Any of these frameworks will let us program on a solid foundation using object oriented concepts producing high quality HTML5/Javascript/CSS3 applications that can be run on any modern browser and any major mobile platform.
- 3 It is possible to implement javascript-based web applications on one HTML page following the “Single-Page Interface Model” , and this is recommendable for building a mobile application based on web standards. However this is normally not the best approach for a browser-based application. Normally, we would like to have some pages and would benefit from using some existing frameworks to dynamically create those pages using server pages technology. However, since the javascript pages have more logic that before, you will have less real ‘pages’ and more logic on them. The recommended server pages-based type of frameworks for this kind of development is normally the time-tested MVC architectural pattern. To follow the examples from point 1, you could use the new MVC 3 framework for .NET or Spring MVC for Google App Engine. Of course, plain JSP or ASP pages can also be sufficient but are more prone to bad programming practices.
- 4. Although the Javascripts frameworks can be very powerful and could support most mobile application development efforts, accessing some native features and packaging for the application stores will not be possible. For this last step, we will use cross-platform mobile application frameworks like PhoneGap to create a truly native application. PhoneGap allows authoring native applications with HTML5/Javascript/CSS3 web technologies to get access to mobile platforms APIs and application stores.
- 5. Think and act Agile. We will have to change our applications often. So, if we can test automatically, we can reuse many of the tests. No more novel-size server pages that we need to scroll several times. Nice code is elegant and minimalistic. Large code is to be avoided. Minimal custom code is to be used since that will often break after minor changes. Agile development relies on good abstractions, object orientation, encapsulation, test driven development, model view controller, separations of concerns, automatic testing and of course use case orientation. (see next point)
- 6. Think and act user centric. If we want to create an application that users will enjoy to use, we need to make sure we understand, imagine and foresee how users would like to use it. We should not ask them, since most will not know. We need to think and create. Using use case analysis, users stories and scenarios is the best way to capture user’s needs, foresee scenarios/use cases and build our application with the user business process in mind. Build a proof of concept, re-do it if necessary from scratch, until some ‘wow’ factor has been achieved. Then increase our scope one interaction at a time without repeating ourselves and never writing anything in stone. Nobody really knows how is the best way to build a good application, not even the user. Both the user and developers need to work together using imagination and the inevitable trial and error process.
-7. Try to use standard/popular technology. Using Javascript/CSS3 and HTML5 for developing the client is clearly a much standard route than using Platform specific programming languages. More programmers will be available and the application will be easier to maintain and scale. Using REST web service interfaces and XML or JSON as transport protocols will set a future of interoperability. Of course, focusing too much on standards may limit innovation, the right balance is key.
In future posts, we will analyze these 7 principles in-depth and will show some simple sample applications with concrete examples. We also will point to various links for further research. We hope to get comments and corrections and make this post a solid and simple recipe for user-centric cloud-based cross-platform mobile development.
The opinions expressed on this discussion room are writer's and don't necessarily represent NTT DATA Canada's positions, strategies or opinions.