rest hard

with all the hype on REST architecture, I thought it would be nice. Well, after some time learning what it is about really, I think it still has potential to be good. But some experiences to remind myself:

tried restlet first, which seems nice. has one single jar file to deploy, includes client and server, and a simple webserver. so nothing else is needed. whee. well, if i only wanted to run restlet against reslet, sure. but try to link that to anything else and i could not find documentation on how to do it. what type of request data does it expect in different cases? etc. etc. maybe now i could be a bit smarter but anyway.. the docs reall suck imo.

then off to jersey, the sun (ok, oracle now) reference implementation. plenty of jar files, a complete mess to deploy. but documents itself nice at least to the level of defining how to expect the @get @post etc. to behave. including the data types of “text/plain” etc. so i can actualy imagine connecting to it from another system with other tools. well, try running that in osgi.. it should come with examples but the whole things is bloody hard to get. finally, tried to get the whole sources and compile it with maven. oh yeah.. after huge downloads by maven it keeps failing. and btw maven proxy configurations suck completely. did i mention i hate maven and all the stupid dependencies and sick directory structures it brings on me? lets put a single class in a separate project and make 100 of those.. uu yeah. and just running “mvn” fails with weird errors. I should do “mvn install” which leads to dependency download hell. end result, unable to run inside osgi due to grizzly server weird classloader issues.

in general, i have to say i hate these lets be smart frameworks that do it al for you through reflection tricks. always leads to problems. just give me simple configuration api please. lots of issues passing any objects to different instances (that is, not doable). at least xmlrpc was hackable.

well, in the end i ended up doing REST in OSGI through the felix httpservice. the whole concept is simple enough to just make a servlet to handle the get, post and other requests. biggest problem is that with the OSGI httpservice you cannot configure a servlet mapping to create urls like restlet and jersey support where a path in the url leads to a resource. well, with the support for filters and their patterns, this is doable it seems and the whole servlet-mapping is not needed. whee, so it works not by tossing all the fancy frameworks. as usual..



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s