When FaceBook launched the "Facebook Platform" (its API) in 2007 it was one of the defining points in its battle with MySpace -- at the time the dominant social networking website. FaceBook's API allowed developers to write applications that ran seamlessly inside FaceBook, accessing and updating user information like a native FaceBook application could. Compared to MySpace's distant relationship with 3rd parties, this open invitation was welcomed by developers.
Not to be outdone, Google and MySpace announced OpenSocial near then end of 2007. According to Google, OpenSocial "defines a common API for social applications across multiple websites. [using] JavaScript and HTML, developers can create apps that access a social network's friends and update feeds." In short, it aims to be a write-once-run-anywhere for social networking applications. While initial reviews in 2007 where mixed, development has continued with version 0.9 released in April. The book was written as 0.9 was being finalized so most of the material is current as of the 0.8 release.
OpenSocial Network Programming is both a tutorial and a reference guide. Essentially readers will learn: what is OpenSocial?, how do you program for it? and how do you make your applications run faster.
The first section of the book looks at the challenges of developing social networking applications and explains OpenSocial's structure. OpenSocial actually built on other API including OAuth and Google's Gadget API. The book first takes the readers though a bit of a tour of several popular social networks and explains how OpenSocial works. OpenSocial was designed to work with multiple social networks ("containers" in OpenSocial) so there a fair bit of coverage on the constraints (screen sizes, versions supported) placed on apps running in, say, MySpace and orkut. By the second chapter readers are learning how to write that all-important "Hello World" gadget before delving into theOpenSocial API.
The next section looks at how to write applications, first using the GadgetAPI, then the OpenSocial, the REST version and finally a chapter on performance.After learning how to develop an application, the performance chapter looks at ways to make your OpenSocial application run faster. The tips in the performance chapter cover speeding things up from the browser and server side using the usual techniques, as well as some tips specific to OpenSocial. One interesting part is coverage of Content Delivery Networks (CDN) which may be new to some developers. Essentially the problem is, with a social network, users of your application might well be spread out across the globe, while your application is only being served from one location, hence performance suffers. ACDN is designed to replicate your content so that it can be served to a user from a server closer to their actual physical location. The performance chapter looks at several CDN that would work with OpenSocial applications.
Overall, this book is quite easy to follow. There is a lot of material to cover, like any framework, it takes a bit of work to understand how all the parts fit together. The main things readers might take from this book is that, while its easy to write the application, it will probably require testing in several social networks. The layout of the book is clear, there's a number of break-out boxes that give some useful tips. There a lot of tables listing various parameters and source code, but it's pretty readable. This is the first book onOpenSocial I know of and readers should be fairly confident with OpenSocial after reading it.
Published: 28th May, 2009