Wednesday, July 25, 2007

Google Translator Restlet published

You can find it here, including a complete tutorial for consuming the service using the restlet framework. Even if your language of choice is not java, it shouldn't be very difficult for you to write your own consumer using the the documentation I've provided.

In brief, it's an asynchronous RESTful service that allows you to create a translation job by posting to a specific URL, and if the job is accepted it returns you a 201 Created status and a Location header telling you where you can pick up the results when processing has completed. Then it's just a simple task of polling the result URL (a job resource). The job resouce will return an HTTP 102 Processing status until it completes, at which point you'll then get a 200 Okay, and your results in UTF-8 encoded text/plain.

I posted about my service on the restlet list several days ago, in an effort to get some feedback on what I might have done better. The biggest point of contention has been the jobs resource url that you post to when you create a job. I chose the first option following the guidelines in the RWS book.

  • /jobs/en,fr
  • /jobs/en/fr
The idea here is that if you have have two pieces of scoping information that are ordered but not hierarchical (the from and to languages respectively), then you should seperate them with commas. Several people, however, have presented a good case for looking at it at as a hierarchical set of folders. I haven't completely made up my mind yet, so comments are welcome.

The other minor point of contention is my choice to use a 102 status to indicate that a job is still being processed. At least one person felt that a 202 Accepted would be more appropriate. Personally I think that a 102 Processing status is a clearer way to express the resource state, if your not opposed to using the WEBDAV extended status codes.

Beyond stress testing this service, I don't intend to become a major service provider so I'll publish the source code to my translate restlet backend eventually. The last two restlet framework releases, 1.0.2 and 1.0.3, both have problems with the servlet adapter. This piece of the framework allows you to run a restlet within any web container. Because of this I've had to code in some workarounds that I'd rather not publish. Hopefully these issues will be cleared up in the 1.0.4 release.

Tuesday, July 17, 2007

Google Translate Scraper 0.9.6 released

Available for download from my software page and from my maven 2 repository.

This is a minor release that improves the exception handling and a few other tweaks. Probably the biggest change is the name, I felt that Google Translate Engine was not a good description. This new title, while a bit less glamorous sounding, is more accurate.

Very soon I'll publish a RESTful service that's build on top of the scraper. Hopefully in the next day or so.

In other news, I recently switched from jboss-4.0.2 to the Glassfish Application Server. So far I'm really pleased with glassfish. I've been running it under a 1.6 JVM with no problems. The web based administration console is really slick.

Friday, July 13, 2007

RESTful Web Services

As promised, here's my quick book review for RESTtful Web Services by Leonard Richardson and Sam Ruby.

This book has a wealth of conceptual information for what the authors have dubbed "Resource Oriented Architecture". They identify three different categories of web services, "Big" web services (those that use WSDL and SOAP stacks), REST-RPC hybrid services, and strictly RESTful web services. They describe the pro's and cons of each, and present a good case for RESTful services.

I set out to create my own RESTful service, and this book really helped me to clarify and design it correctly. For java developers, unless you know ruby or have a strong desire to learn it, feel free to skip Chapter 7, where the authors implement a RESTful service using RoR. The implentation details of this book aren't what makes it great, it's the concepts it describes, so don't get bogged down in the details if you don't need to. In fact the website has restlet implementations of all the examples in the book. That's going to help a java guy much more than the ruby examples. The section on restlets is brief but useful for getting started, I read this section at least three times.

The restlet framework has been a joy to work with so far, and I'll probably be releasing the source to my restlet implementation very soon.

If your interested in learning REST, and want to understand it in more developer-friendly language than Fielding's now famous dissertation, then I highly recommend reading this book.

Tuesday, July 10, 2007

Dumb IT Hiring Managers

I've had a big pet peeve about IT hiring practices for several years now. I'll be perusing the IT job listings on a board, and typically I always find at least one position with an absurd set of requirements.

Today, I received an email from an unknown IT recruiter about a java position in Plano. One of their core requirements for the position was 9/10 years of J2EE experience.

The J2EE 1.0 specification and reference implementation was released sometime in 1999, and as far as I know, the first full implementations weren't shipping from vendors until 2000. Wikipedia has a J2EE timeline here. If you started working with J2EE the very moment the 1.0 specification was released, you could at most have about 8 years experience.

I also think that requiring X number of years with a particular technology is a dumb way to look for competent people. I've seen plenty of developers who've been doing java for three or four years and still haven't figured out that the Collection interface has a built in iterator.

What hiring managers should be looking for is scope and breadth of experience. How many technologies have you worked with, and how many years have you been a developer overall? Do you write code on your own time, or do you just reluctantly churn out enough lines to keep your manager from frowning at you? I wouldn't ever hire someone who doesn't enjoy programming, but then again, nobody's asking me.