Mashing Up the Cloud with Force.com Toolkits

Dreamforce is a great forcing function for the Force.com Developer Evangelism team – an excuse to finish off a couple of side projects and make them fit for human consumption. For example, back in the spring, I did a proof of concept of a Force.com Toolkit for SimpleGeo, the geo-location web service – an Apex wrapper for the SimpleGeo REST API. Since native JSON parsing didn’t make it into the Summer ’11 release, and the Apex JSONObject in the Apex Library project, while functional, quickly hits the script statement limit when parsing more than a few kB of data, I put it on the shelf. When it came time to propose sessions for Dreamforce, I had an opportunity to dust off my SimpleGeo toolkit code. Native JSON support should be coming soon (safe harbor!), and, in any case, surely I could work around the script statement limit?

Then I thought – how about mashing up my new SimpleGeo toolkit with the existing Facebook toolkit? A mobile, social app! The use case I settled on was a simple one, hardly the basis for a startup, but enough to show how multiple toolkits can be combined to make a whole much greater than the sum of its parts – a Facebook app that obtains your location from the HTML5 Geolocation API, creates a corresponding record in a SimpleGeo Layer, retrieves from that Layer a list of other nearby users sorted by distance, and displays that list, with links to users’ Facebook profiles and an ‘add friend’ button for users who are not yet friends.

Quite a lot of functionality there, yet I managed to deliver it in less than 200 lines of Visualforce and Apex, since the toolkits provided nearly everything I needed. You can hear the full story in my Dreamforce session ‘Mashing Up the Cloud with Force.com Toolkits‘. Since the original session coincided with Platform State of the Union (Thu Sep 1, 11:45am, Moscone West 2001/2003), we added a replay:

  • Wed Aug 31, 12:30pm, Moscone West 2020
  • Thu Sep 1, 11:45am, Moscone West 2020
If you can’t get to Dreamforce, or you’re just plain impatient 🙂 , you can grab the sample source and toolkits from my GitHub repository at https://github.com/metadaddy-sfdc/DF11Mashup.

Leave your comments...

Mashing Up the Cloud with Force.com Toolkits