1. Jul 20th, 2006

    Java: The future is REST and Rails

    InfoWorld brings us news of serious and exciting changes in Java’s future. According to the article, most of Java will be open sourced. “Most” is left undefined for now. But most is better than not, so that’s goods new.

    It gets even better. Java will also …

    “The Ruby on Rails Web framework also may be supported.”

    Can you say javax.rails?

    And to show that Sun knows what the cool kids are up to these days, Java will also …

    “Also at Sun, the company is eyeing the addition of lightweight REST (Representational State Transfer) Web services … An announcement is expected in four to six weeks.”

    Finally! Sure, Java had java.net and javax.servlet for a few years now, but to do the real heavy lifting that is REST, you need a framework. All those resources don’t come for cheap, you know.

    The details are a bit sketchy. (I still can’t get past the excitement that we’ll be able to use javax.rails!)

    I can only imagine it may look something like this:

    import javax.rest.*;
    
    public class SimpleCall {
    
    public void simpleCall() {
    VerbFactory verbs = VerbFactory.newInstance();
    Verb verb = verbs.createVerb("post");
    ResourceRepository resRep = ResourceRepository.connect("rest-conf.xml");
    Resource res = resRep.lookup("http://myserver.com");
    Invocation inv = res.createInvocation(verb);
    Request req = inv.createEmptyRequest();
    Response res = inv.invoke(req);
    inv.close();
    res.release();
    resRep.disconnect();
    XMLUtils.output(res.getDocument(), System.out);
    }
    }

    Ok. That was a cheap shot. But I just couldn’t resist.

    1. Jul 21st, 2006

      Sterling Camden

      ha! yeah, that’s agile.

    2. Sep 6th, 2006

      Labnotes » Rounded Corners

      [...] I wish I was wrong. I wrote this post a while back, poking fun at Sun for creating an impossibly complicated RESTful API that will pain developers for years. I imagined an API that will require twenty lines of code for a simple hello world. Of course, I made it all up. Now I wish it was just a joke. [...]

    Your comment, here ⇓