While AJAX was off on it’s long journey from Desktop to Mobile the “Model View Controller (MVC)” legion descended on the desktop web programming world. MVC has been hidden in everything from ASP.NET, to PHP, to Ruby On Rails. The dirty little secret of MVC style programming is that it confuses the traditional “3 Tier Programming” model. The presentation layer (User Interface) and application logic gets all gummed together since the UI gets driven directly by processing that happens exclusively on the web server. On the desktop, MVC isn’t fatal since desktop computers are generally connected with fast broadband pipes all the time. On mobile, however, native apps have exposed the soft under belly of that paradigm – who wants to wait for a round-trip to the server every time the user does something on their phone?
We should all take a moment to look at mobile web sites and think what life would be like if they all felt a little bit more like native iPhone apps. Why should mobile web sites impose a worse experience where users wait while pages constantly reload. How can we make the experience feel “more native”? Well, that’s what AJAX is all about. How can we get there? As Agent Oso says “Three special steps – that’s all you need” (extra credit for knowing the reference):
3D transforms, spinners, multi-touch, swiping, and all kinds of great UI effects are exposed in the WebKit based browsers including iOS, Android, Symbian, WebOS, and Blackberry 6.
Step 2: Use PHP, ASP.NET, etc. only to expose data transfer web services
Don’t use PHP or other server side technologies to layout the client-side UI. Server-side technologies are best for being a conduit to data. Use them to format data in XML or JSON for consumption on the client-side of your web application.
Step 3: Think “offline”
Design you app as if it should be useful even when your user is on a plane with no internet connection. HTML5 and appMobi expose extensive caching mechanisms. Everything from images to data can be cached on the device. Every image and every piece of data that has to go over the network is a separate request to a server – it makes things unbearably slow sometimes. Cover the offline case first and the online case becomes easy. It also will follow that your users will have better experiences with your brand regardless of their network connectivity.