Skip to main content

Major themes of JavaOne: REST, Ruby and NetBeans

Posted by joconner on May 9, 2008 at 2:00 PM PDT

Hundreds of sessions, thousands of people...and what did I come away with? Lots of t-shirts, plush toys, and more t-shirts. Oh, and 3 main things related to my work: REST, Ruby, and NetBeans.

REST -- Want to communicate with web services? You'd better learn something about REST APIs. I can't give a full tutorial here. I hardly know enough myself. But I can give you some info.

  1. Give everything an id. That id will become part of a URI. Think of your application in terms of resources and URIs that access them.
  2. Use the standard HTTP vocabulary to act on those resources: GET, POST, PUT, DELETE, and a few others. There's nothing complicated here. GET /customer/1 retrieves infor about customer 1 in the app. POST /customer sends customer information for a new customer. A new id gets generated. PUT /customer/1 updates some information about customer 1. And DELETE /customer/1 removes that object. Simple vocabulary. Use it.
  3. Provide multiple representations of resources. You can use content negotiation or different URIs to retrieve multiple representations of the same data.
  4. Use stateless communication. Avoid sessions whenever possible. Put whatever you need to process a request in the URI.
  5. Finally, use some decent patterns. The container-item pattern is useful. GET /container provides a list of items. POST /container creates a new item in the container.

Some of the benefits of a RESTful architecture on the server side: scaleability, cacheable resources, reduced coupling. On the client side: resources are bookmarkable, you can easily test from a standard browser, you get broad programming language support for REST through standard HTTP, and you can get access to multiple formats for the data depending on your client capabilities and content negotiation.

Ruby -- Lots of sessions talked about Ruby or JRuby. You couldn't escape Ruby. Ruby running on Java, Java from Ruby, Ruby from Java...it's a mixed up, crazy, beautiful combination. And you know the part I really liked. Apparently, once you create your application using Ruby (and Rails of course), you don't have to sound the alarms with your IT department by introducing another server to them. Supposedly, and I haven't tried this yet, you can deploy JRuby on Rails applications as WAR files on a standard Java application server. That's impressive.

NetBeans 6.1 -- I know that you have many IDEs to choose from. And you may have already selected. But just do me a favor, do yourself a favor...take a new look at NetBeans. Version 6.1 has all-new support for JavaScript, excellent Ruby integration and editing, and access to databases and several application servers in a single download. I've been dabbling with Eclipse. I'm working with a team that's considering Eclipse as their new IDE after working with IntelliJ. I can't let them do it. I have to get back to them next week and stop them while they still have time. NetBeans, it's the only tool we're going to need to do our JavaScript and HTML front ends, business logic on the Java EE middle-tier, and even modify, edit, and maintain our MySQL database on the backside. Check out the latest NetBeans and see what you think. For more information about NetBeans 6.1, including my own more detailed review, check out NetBeans 6.1: Worth a Try.

Related Topics >>

Comments

What about Groovy? I heard that drew a lot of attention at Java One. I've used both Ruby/Rails and Groovy/Grails and must say that Groovy is a great dynamic language that integrates seamlessly with Java. Also prefer Grails to Rails.

Maybe it is because I use OS X Leopard, and I "only" have a Quad Core Xeon Mac Pro with 8 GB RAM, but I have yet to see an application that runs as slow as Netbeans 6.1 on my machine. On my PowerBook G4 1.67 GHz with 2 GB RAM, the runtime behavior of Netbeans simply is unacceptable. If that is the best that Swing can do on OS X, then I wouldn't touch it with a flag pole.

Eclipse runs great on the Mac Pro and good enough on the PowerBook. So I cannot let anybody use Netbeans, but have to recommend Eclipse instead.

Do you have the Java SE Development Kit (JDK) 5 Update 14 (version 1.5.0_14) or newer (including JDK 6 Update 4) installed on your system?