OpenSocial’s REST Protocol, Taking It On The Chin
For my job, I’m looking into social-networking related web-services, particularly RESTful ones. Naturally, this meant starting with OpenSocial’s 0.8.1 REST protocol, and reading more specification documents than I generally care to. OpenSocial neatly standardises the solution to a number of problems that I’ve been given, particularly around providing an interface for the storage and retrieval of a user’s activity on bbc.co.uk.
Even more interesting are the reference implementations for these interfaces provided by Shindig, conveniently (or not, depending upon your particular brand of fanaticism) written in the BBC’s current preferred service-layer programming language: Java. The code additionally looks pretty sensible, as laid out here, by using useful technologies like Maven and Jetty, and generally not looking like a massive pile of fail. The only constructive criticism I would bring is that the REST request handling or routing doesn’t use any of the standard frameworks, particularly Restlet.
The lovely @sicross pointed me at SocialSite, a Sun initiative that looks to extend the OpenSocial specification and Shindig code-base. This is all well explained, in 2 parts, here. The particular extensions to the REST interface, of note, are mostly around friending other people, groups and messages. SocialSite is certainly interesting, and covers areas that I’ll need to develop in the next x months. However, at first glance it doesn’t have the same maturity of code-base and documentation of Shindig (which is pretty green itself). Even the wiki is nigh-on impenetrable! Additionally it has diverged from some of Shindig’s technology choices by employing Ant and Glassfish, which seems a shame.
The main reason for my writing this post was actually the interesting discussion that the OpenSocial RESTful protocol, and SocialSite’s extension specification, has generated. Representational State Transfer was, as everyone knows, defined by Roy T. Fielding who recently gave SocialSite’s REST API a bit of a panning and then went on to give it to the OpenSocial specification. Now this must be quite hard to take and certainly makes me feel embarrassed of any supposed RESTful interfaces I’ve ever spec’ed (especially as I’m going to be reading his article and comments a few more times before I understand any of it). Thankfully, @snoopdave (who I’ve already linked to twice in this piece) appears to be taking this pretty well and has started a google-group discussion on how the OpenSocial API can be enhanced to meet Fielding’s criteria.
Good to see criticism being taken as constructive!