Saturday, April 28, 2007

Do we need frameworks for REST?

Many REST frameworks such as Restlets and simple web are gaining popularity of late. There's also a new JSR to give Java developers a new API to build RESTful web services. It's quite natural that as more people "get" REST they look for ways to simplify building their next REST web application / service.

And while I admittedly have to yet fully "get" REST, whatever I have got so far is certainly not by using frameworks that let me implement REST by writing POJOs but rather by extensive use of the POW (Plain Old Web) and POGS (Plain Old Google Search). And applying the principles I learned by using POS (Plain Old Servlets).

This is not a criticism of these frameworks. May be I still haven't understood the role of these frameworks. And may be once I do understand their goodness I myself will start using them.

But my question is this - why are servlets not good enough? Sure they have their limitations. But rather than have yet another framework or a brand new API, why not have a JSR to fix the servlets and JSPs themselves? (A good start would be to not enable sessions for JSPs by default.) After all isn't it the convenience of using frameworks galore that has kept the larger community from understanding the goodness of HTTP? Isn't it the same convenience that has made it a common practice to use (bloated) sessions?

You have to wet your feet to tread the waters. You have to get your hands dirty in HTTP to implement REST.

2 comments:

Abishek Kumar said...

Hi Keyur shah.

I am new to REST API'S, Iam very confused about Implementing REST and was thinking of adding any frame or plug in in Netbeans to implement in my project.
If your idea is we dont need it.. then can you please share any example or points like how it is possible for begginers like me.

I would appretiate if you can post some thing about rest how to use it with EJB3.

thanks in advance for any advice..!


abishek
San Jose, CA

Nicolas Zozol said...

Hi,
I'm pretty OK with you. A framework like Restlet gives you more constraints than tools.

I've made a translation of my tutorial on a nice way to use REST with JSP



If you have any comments, please e-mail me :)