How OpenSocial v0.9 streamlines your app

Thursday, May 21, 2009 at 11:14:00 AM

One of the major updates to OpenSocial in the latest version is a new programming model that allows you to send social data directly from the container to your application's server, where you can use the data to render any content you want to show the user. This model lets you use your existing presentation layer (faster coding!) and reduces the number of requests needed to pass social data between clients, containers, and your app server (faster apps!). Here's a closer look...

Many apps want to combine the social data from the container with the application data that lives on their server. In previous iterations of OpenSocial, many apps did something like the following:

  1. Client requests profile and friend info from the container (via DataRequests)
  2. Container responds with the social data
  3. Client requests application data from a remote server (via makeRequest)
  4. Container proxies request to remote server
  5. Remote server responds to container with application data
  6. Client combines the social and application data and presents it to the user (via JavaScript)
With v0.9's streamlined approach, the container can send social data to a remote server via "data pipelining" and you can combine that social data on your server, using your existing presentation layer, with a technique called "proxied content." The new flow looks like this:
  1. Client requests an application view
  2. The container sends social data to the remote server
  3. The remote server combines social and application data, returning HTML and JavaScript
  4. The container sends the content to the client
Much cleaner! These new features are already live on sandbox.orkut.com and will be coming soon to OpenSocial containers everywhere. To learn how to use data pipelining and proxied content in your OpenSocial app, check out this new tutorial.

Happy coding!

1 comments:

Yusuf (YNZi) said...

This is awesome. A good step in simplifying opensocial.