fredag 13. november 2009

Twitter programming session

Last night I had a live programming session with ~30 CS students at the University of Oslo. The goal was to show how easy it is to interact with RESTful webservices in Java. I started out with explaining about HTTP and Jersey, REST vs SOAP, JSON vs XML and jsonlib vs jaxb. Those were the major design decisions.

I subsequently implemented a bot that would befriend anyone that was following the bot. Doing this with jsonlib was pretty straightforward, but showed the weakness of not having a higher level abstraction of the domain. Therefore, the next bot would get status updates from his friends timeline, and show them in a simple GUI. This proved a lot smoother when jaxb was at work, because it created two separate layers: one interacting with twitter restful webservices, and another showing model objects in the GUI. Last I showed a bot that used twitters search api to follow a trending topic.

Overall it was a good session, but I think it was a little bit too packed with technology choices. I guess it would have been of greater value to just show the magic of jaxb, and skip the primitive alternative.

The javabots is available for download at http://bit.ly/FyeqT for a while.

Ingen kommentarer:

Legg inn en kommentar