As part of my ICS 414 (Software Engineering II) class (the continuation of ICS 413 from last semester), I was recently thrown into the deep end of Restlet. REST, or REpresentational State Transfer is basically a set of concepts dreamt up by Roy Fielding a number of years ago. REST provides a way for resources (and services) to be accessed remotely by machines. Sounds a lot like the web doesn't it? Well, your right, but wrong at the same time. The WWW protocol provides a perfect platform to implement REST, but not vice-a-versa.
Honestly its all a bit confusing, so screw your head back on and enjoy these educational links:
http://tomayko.com/writings/rest-to-my-wife (Highly reccomended)
http://en.wikipedia.org/wiki/Representational_State_Transfer
https://sites.google.com/site/ics414spring2011/modules/rest
The last link is my class webpage, which holds the assignment du jour: Assignment A04 : Restlet Code Katas.
I should point out that these were not the nice little Katas from last semester. These were big, scary, nun-chuck-wielding, feat-of-programming-prowess Katas. Let me start by pointing out that the documentation for Rest is not great, so if your thinking about picking it up in your spare time, expect to spend a few hours trolling tech-forums for the most obscure solutions you've never thought of. The crowning jewel in all this is that you can programatically pull data from online resources, and use them for your own (potentially nefarious) purposes.
To the Katas:
Distribution: http://ics414-spring2011.googlecode.com/files/gburgess-restlet-1.0.118.zip
Kata 1: Time resources
This was fairly simple, just copying, pasting and tweaking. This ultimately provides resources to pull the hour, minute, and second. This was simple enough to finish in class (<60 mins).
Kata2: Logging
This sounded easy, especially since my professor indicated "logging in restlet can be done in just a few lines". Well, I spent hours working on this one. The restlet API was of help. I came pretty close to figuring it out before one of my teammates solved it. I passed over the answer in my search for truth, but overlooked it because it didn't sound like it fit the bill. (>5 hours)
Kata 3: Authentication
It sounded easy...but unfortunately these things rarely are. I got it working, although my cohorts report some difficulty getting it to work on Mac (*scoff*) platforms (to which I point out the ninety-something-percent compatibility rating). The devils in the details. I swear I spent more than 8 hours trying to figure out how to make three lines of code jive. Although I must say, this is actually pretty useful. (>8hrs)
Kata 4: Wicket
Writing this little program was like trying to catch a hornet with a thimble. It sounded difficult, and it was. After a marathon 8 hour programming session, I gave up. Essentially the order was for a wicket form that pulled data using rest from the dateserver. I could pull data from the date server without a problem, and the other little details (jar.build.xml & ivy downloads) were taken care of by another team member. My real struggle was with the wicket form. I for the life of me could not figure out how to handle the session properties. The plan was to implement a bunch of checkboxes, so users could choose what data to pull, and then have them click a submit button to pull up the desired data. Well as it turns out, keeping track of what checkboxes are checked, is really hard. Aside from the wicket form, everything else worked all right. ( >8hrs)
http://ics414-spring2011.googlecode.com/files/gburgess-restlet-1.0.118.zip
No comments:
Post a Comment