Download THE DATA CENTER

Transcript
this application on the social-networking site
(OpenSocial container) of our choice, and it’ll
work just fine.
Adding Social Functionality
“Hello, world” is boring enough as a standalone
program; using it as an example of a socialnetworking API seems almost silly. For a gadget to
become a fully fledged OpenSocial application, it
needs to demonstrate an ability to interact with
other people. More precisely, a socially aware
application should be able to find out something
about me and my friends, as well as what I (and
my friends) do.
The OpenSocial API addresses this by offering
three types of functionality:
I People and relationships: get information about
you, your friends and the various pieces of data
associated with those friends. The Person class
provides access to this information.
I Activities: social-networking sites are interesting
because they let you interact with your friends in
a variety of activities. These activities can range
from exchanging messages to answering questions in an on-line poll to keeping up to date
on the latest sports scores. OpenSocial sees
an activity as a collection of actions within a
particular container. The Activity class provides
access to this data.
I Persistence: OpenSocial makes it possible for an
application to store information between sessions. One of the most interesting aspects of this
persistence API is the fact that storage is handled
by the OpenSocial container, not by the application. There is no Persistence class for handling
such data. Rather, the data is read and written by
invoking methods on the overall opensocial
object. Note that the persistence layer lets applications store data globally, as well as on a per-user
or per-application instance basis, as needed.
Interactions with these three objects, as well
as with the OpenSocial API in general, is done via