6. More on APIs for Mobile app development
AjayChebbi devWorks 270004DG8B Visits (1400)
Data centric APIs
In the last post I went over how having a ready made API made building the prototype of the mobile app very easy. We could focus on trying to build the MVP. But I think we got lucky. The folks who designed Jazz and RQM made a good decision to provide REST APIS for all the artifacts in the app. This is not the case always. Most of the times legacy (pre Web2.0) web apps are built in a way that gives a HTML/JS on a GET. If you have a AJAX based UI then you probably have some form of API that is data centric v/s content centric. For building Mobile apps - you need data centric APIs. Its almost like we are back to the Client Server world. Actually a Mobile app is at a 30,000 feet level a classic Client-Server architecture with some tweaks (you kids may not know about what I am talking about!).
Mobile apps for existing business applications
If you are building a brand new business with Mobile as your delivery channel - or the mobile app "is" your business (remember the the bird shooting app ) you have the flexibility of developing some beautiful and scalable back end APIs. I'm not going to go there. My current experience has been about creating a mobile app for a existing server (yes, I am that old!). I'm going to hazard a guess that there are a lot of folks out there that are in the same boat (a shout-out to all these brave souls!). Like I discussed in the last post, you need to have some APIs that provide you data in a compact format. You have the option of either
Building the facade
Worklight provides you with one such facility called worklight adpters. There are ready made patterns for a host of common back ends. If thats not for you, you can write your own adapter to connect to your tin can! This is also a great place to write aggregate services that the app can call that would otherwise need several trips back and forth. This is also the place to have session caches so that the mobile app interaction becomes faster. One use we had in our prototype for a Worklight plugin was for auth management and XML parsing.
The quintessential Mainframe question
What if you have green screen applications and you want to provide part of that business functionality for the mobile employees? There is a app for that! (ahem.. I mean technologies to do that). Of course you can use things like the CICS REST service etc. But if you have a 3270 character based application that was written before you were born and no one knows anything about it! There are some interesting technologies that can be used to build the Facade. One such is IBM HATS. Its a thingamajig that sits between the telnet pipe to the mainframe and the XML over HTTP world. Installation on the mainframe not required! You can construct a webservice that you can do a GET on
which in turn make calls to the mainframe app and wade thru 3 TTY screens using keys that don't even exist on your keyboard! You can then return a simple XML/JSON like
that you can write a mobile app on. You know how to write a mobile UI on that!