Red Hat

Seam and RESTeasy

Posted by Jay Balunas    |       |    Tagged as Seam

There has been a post or two regarding Seam and RESTeasy in the Seam forums, and the RESTeasy mailing list so I thought I would share my opinion as to where these technologies could fit together. I have been thinking about this since talking with Bill Burke at his JUG talk on RESTeasy.

For those who are not familiar RESTeasy it is an implementation of the JAX-RS specification that Bill Burke is working on. See RESTeasy project page for more info.

Some people get hung up on how these two technologies can integrate because Seam is by nature and definition a stateful framework, and REST by definition should be stateless. The question is not do they integrate, but can they co-exist?

I see two primary ways for Seam and RESTeasy to work together :

  • Multiple ways to access/manipulate the same server side component.

If I have a Seam component (EJB or POJO does not matter) and I want to have it accessible via a restful call. I should be able to put the correct annotations on it from the JAX-RS spec, and have RESTeasy manage restful access. This EJB/POJO would effectively be both a seam component, and a restful service.

  • Seam using restful calls as a result of a user action, or to pull data

Take for example a Seam application that displays TV schedules for any zip code in the country, and lets users create a calender of what shows they want to watch. Seam internally could make restful calls to an existing service for all of the TV schedule information. When the user selects a show the seam application captures the information from the service, and processes and stores that information locally using EJBs, POJOs, or whatever.

I suppose providing an easy way for Seam to access a remote restful service as a seam component would be useful. It could treat it like a stateless session bean, or something like that. Users today need to write the plumbing to make the restful call, and manipulate the return. I'll have to think on that some more :-)

My $.02

back to top