« Ruby GC and copy-on-write | Main | Rails vs Java »

March 23, 2005

REST update

I had lunch today with my friend mentioned in my previous REST/SOAP post. He's been developing REST services using Tomcat, and is pretty pleased so far. He's got five service resources implemented so far, with only a few days of effort expended. We talked a bit about the scaffolding he's been building and we went back and forth discussing implementations and general J2EE stuff. One of the topics we spent a lot of time discussing was general J2EE development speed when combined with a good IDE like Eclipse. We used to work together on C++ services, and the develop/build/link/debug cycle took a bunch of time.

Just building a service took 5-10 minutes, and there were often runtime linking issues we'd have to debug and figure out. It didn't help that the C++ service frameworks we were consuming were changing pretty often, sometimes in non-backwards compatible ways. We worked together on a project that was using uncommon features of the frameworks, and banged our collective heads against the wall for quite a while, since there were all sorts of quantum bugs that would come and go as library versions changed, or even things as simple as the user environment. It was common to develop and debug only 50 lines of code a day, which drove us up the friggin' wall.

With J2EE and Eclipse, he's been writing as much code in an afternoon as we used to write in a week. A big part of that is using Java instead of C++, since there's no real link phase (and much shorter build times) and memory management is easier (as long as you are smart with variable scope and problem objects like strings).

There are two other productivity boosts, namely Eclipse and the rich J2EE apis. Having pop-up menus that show a list of potential methods for an object (along with their javadoc) makes things move along so much more quickly. We used to use vi/emacs for our editing, and while they can use ctags, Eclipse's code and method navigation is much higher level and more mature. It's not limited to Eclipse, any modern IDE would give good results, but Eclipse is the one that feels most natural to us.

The J2EE apis are pretty complex, and often maligned for that complexity, but I don't think their learning curve is as steep as some people make it out to be. It would suck trying to do J2EE with an 70s style editor like vi or emacs, but modern IDEs like Eclipse make it pretty straightforward. Eclipse even has wizards that help you generate boilerplate for different service patterns and best practices (as do the other Java IDEs), so if you get really lost, you can get some help from the IDE. You also get all sorts of patterns in the J2EE apis themselves, so things like caching, service directories, snmp, etc are available for use or can be adpated to your needs readily. There's no real equivalent on the C++ side of things.

I've been reading Rod Johnson's recent book, J2EE Development without EJB, and I like it a lot. Most of my J2EE work has been with servlets and lightweight services, and I wanted to broaden my J2EE toolkit while saving the EJB work for a later date, so the book has been fun.

On a lunch note, we went to Jack's Fish Spot in Pike Place Market and got the fish and chips special; he got the cod, I got the halibut. Jack's is a great place for lunch, since it is part of one of the big fish stands in the market, and the fish is as fresh as you can get. They fry the fish perfectly, it was the best fish and chips I'd had in quite a while.

Posted by djb at March 23, 2005 07:14 PM

Comments

Post a comment




Remember Me?

(you may use HTML tags for style)