Seminar on JAX-RS and RESTful services
Last Wednesday I held a seminar on RESTful webservices with JAX-RS. There were about 10 persons present and it went very well I think! At least I got much out of it. I always feel that you learn a lot by teaching others and doing all the preparations and investigations required before the actual gathering.
As I suspected before the seminar there were some questions/opinions/wonderings around the subject of how hard you must follow the guidelines for a RESTful service to be able to call it a RESTful service. Our highly respected chief consultant Dennis Djenfer pointed out the mostly forgotten guideline “Hypermedia as the engine of application state”. I had completely missed this guideline. This guideline seems to be something that is often missed or ignored in tutorials and examples about JAX-RS. After some googling it seems that JAX-RS 1.1 does not support this in a good way. Many people have written blog posts about this and claim that many JAX-RS implementation and usages are unrestful because of the lack of support for this feature. I have also read that this will be easier to achieve in the upcoming JAX-RS 2.0 release. The Jersey implementation though seems to have some support for doing this in a convenient way. Read more about this in the following links:
RESTeasy – where did the hypermedia go to
Declarative Hyperlinking In Jersey
Wikipedia – Java_API_for_RESTful_Web_Services (section about JAX-RS 2.0)
During the seminar I promised to attach the PowerPoint slides and code examples in this blog post. But since it´s not possible to attach files in blog posts I have to get back to you with a new post later on with links to the files, when I´ve managed to find a suitable place to place them. Unfortunately I will not have time to complete my examples with hypermedia linking. Maybe I will do this in another post when JAX-RS 2.0 is released