Skip to main content

Comments on JSR 311

Posted by mhadley on August 17, 2007 at 2:57 PM PDT

Patrick Mueller has some nice things to say about JSR 311 but also has some concerns that I'd like to address.

The first and easiest to address is the license under which the RI (Jersey) is distributed. Rather than GPL as Patrick states, Jersey is actually available under the CDDL license. Apologies if that wasn't entirely clear from the Jersey home page, I've just fixed that.

Patrick also raised a metaphorical eyebrow over some of the non-goals listed in the latest editors draft of the specification (PDF):

Support for Java versions prior to J2SE 5.0: The API will make extensive use of annotations and will require J2SE 5.0 or later. Read: Sorry, J2ME. Sorry, folks stuck on Java 1.4.

Yes, certainly it would have been good to be able to offer something to Java 1.4 users but we felt that an annotation-based approach offered the best solution going forward and decided to focus on that. On the Java ME side, the fact that 311 is primarily a server side API (see the final point) means it is less suitable for the ME environment anyway.

Description, registration and discovery: The specification will neither define nor require any service description, registration or discovery capability.
Read: We'll figure this out later; hopefully we won't have to change anything in this spec once we start thinking about this aspect of the problem.

Several folks whose opinions I respect think that description is antithetical to REST and given that there's no accepted standard for describing RESTful Web services (beyond the resource representations themselves) its hard to see what we could have done here. Certainly I have my own favorite description language and Jersey will automatically produce a WADL description of a set of JSR 311 resource classes but it would be wrong to require support for something like WADL in JSR 311.

Client APIs: The specification will not define client-side APIs. Other specifications are expected to provide such functionality.
Read: We'll figure this out later; hopefully we won't have to change anything in this spec once we start thinking about this aspect of the problem.

The goal of JSR 311 is to make it simple to write RESTful Web services in Java. Of course we're keeping an eye out for classes and interfaces that might be useful on the client side (those concerned with URI manipulation seem like reasonable candidates) but the primary focus is on exposing Java objects as RESTful services so I don't think there's too much danger of unexpected overlap with any new client-side HTTP API that might emerge in the future.

Related Topics >>