October 01, 2005
Cool BeansRick Wayne
Three Java development environments built on the NetBeans platform provide powerful tools for building anything from applets to enterprise Web applications.
We Java developers are cool. Focused. Pragmatic. Hysteria is not supposed to be part of our job descriptions. We concentrate on the problem to be solved, instead of on the tools used to solve it, right? Ha! Here's a recipe for Instant Developer Hysteria: Just swap his IDE for a different product. The victim will coolly focus on the pragmatic problem of detaching your limbs from your body; the less-violently inclined will simply spin shrieking in their Aeron chairs until pacified.
An IDE is a "sovereign" application, to use Alan Cooper's term, one that dominates your desktop and your working hours. Like a leather hiking boot, it adapts to youand you to itover time, until even its shortcomings acquire a familiar patina. For many programmers, their development environment is as personal as a toothbrush, and they're as likely to switch IDEs as to swap toothbrushes with a colleague. Nevertheless, there are concrete productivity-affecting differences between the competitors. It's not just personal preference, folks, or Software Development wouldn't bother with reviews.
Java IDEs face a remarkably crowded market, and Java developers rejoice in the fruits of that competition. The 600-pound gorilla was once Borland's JBuilder. It's still a very capable, well-supported enterprise IDE backed by a variegated cast of third-party add-ons, but an entire ecosystem of plug-ins and products has bloomed around the free, open source Eclipse platform. (In fact, Eclipse has stolen so much of the industry buzz that competing products' bees really have their work cut out for them.) Also, for sheer get-out-of-my-way editing bliss, nothing beats IntelliJ IDEA. But wait: There's still more! Every time you download a new Java JDK from Sun, it offers to bundle the NetBeans development environment. The crucial question, of course, is how NetBeans (which originally grew from Sun's Forte IDE) measures up to the competition.
NetBeans is actually a family of products for Java development. There's the open source NetBeans platform itself, analogous to Eclipse. It's available direct from www.netbeans.org or bundled in Sun JDKs, and is the foundation for the entry-level Java Studio Creator IDE and the all-encompassing Java Studio Enterprise IDE. Note that for this review, I gave Java Studio Creator 2004Q2 only a cursory glance, focusing instead on NetBeans 4.1 and Java Studio Enterprise 7. For conciseness's sake, I'll refer to Java Studio Creator as "Creator," Java Studio Enterprise as "SE7," the open source NetBeans product as "NB4.1," and the entire product family as "NetBeans."
I evaluated Creator and SE7 preinstalled on another new product from Sun, the Ultra20 workstation, which is an interesting tool in its own right. The mid-range box Sun shipped me sports a Model 148 Opteron 64-bit, 2.2GHz processor, a gigabyte of RAM and a Quadro NVS 280 graphics accelerator. Along with Creator and SE7, the box also comes preinstalled with Sun Studio 10, Sun's IDE for C, C++ and Fortran on top of Solaris 10. I also installed NB4.1 on a 1.0GHz Athlon desktop machine with 512MB RAM, as well as on a 1.13GHz Pentium III laptop. Performance was acceptable on all three; I found it hard to judge on the Opteron because I never managed to hand it a task sufficiently complex to induce a measurable wait. That's fast.
Walk a Mile in NetBeans' Shoes
NB4.1 and SE7 both offer refactoring support, though it falls short of Eclipse and IDEA since the NetBeans tools provide only Rename, Change Method Parameters, Encapsulate Fields and Move Class (SE7 trades Change Method Parameters for Extract Method). Ant is NetBeans' native build-file format, and there's a nice wizard for importing an existing Ant project; it parses the build file to hook up commonly used targets with menu commands for building, cleaning, testing and running your project, as well as generating its Javadoc. While NB4.1 and SE7 are perfectly adequate for running and debugging your projects, I personally prefer Eclipse's more-flexible mechanisms, which let you create and save run/debug profiles that are tied to classes, not projects. JUnit support is excellent in SE7; you can generate test harnesses automatically from a class, and there are plenty of choices for doing it. (I was particularly delighted that SE7 could build test suites for me, a boring chore in other environments.)
Version control system (VCS) support is also sufficient; out of the box, NB4.1 supports CVS, PVCS and Visual SourceSafe, and provides command-line support for other programs, too. (Check www.netbeans.org for other profiles, as well.) SE7 supports CVS and ClearCase, and uses a directory-mount paradigm for VCS operations. Note that there's no dedicated VCS view, as in Eclipse; the project view shows at a glance whether files (though not higher-level entities like packages, source folders or projects) are up-to-date, and context menus allow all the usual VCS operations, with both visual and textual diffs available.
Constructing complex user interfaces has long been a bete noire of Java programming; JBuilder and NetBeans have led the pack here, with Eclipse's Visual Editor really joining the party only this year. NetBeans uses the familiar canvas/palette/properties layout, but what's more interesting is that all three NetBeans products support WYSIWYG UI editing on the server side, via their support for Java Server Faces (JSF), which one Web author termed "the third kick at the Web GUI cat" (www.theopensourcery.com/javajsf.htm). If you're ready to abandon Apache Struts in favor of the official Sun-blessed technology for building Web applications, NetBeans' collection of wizards and sample projects may simplify the switch. Studio Creator's forte (you just knew I'd work that in somewhere, didn't you?) is providing developers with a simple GUI editor to quickly get an application running, whether it's backed by a database, Web services or Enterprise JavaBeans. JBuilder offers similar visual tools for JSF; to my knowledge, you must purchase a plug-in to do the same work as Eclipse.
SE7 also lets you build applications from databases or Web services, albeit with a bit more clicking about; you can also generate Web services from J2EE components. If portlets are your Web application model of choice, know that SE7 can create JSR 168-compliant Java classes and portlet.xml files; just extend the generated code to create a running portlet. Third-party tools exist to accomplish this with other environments, of course, and JBuilder Enterprise has the Vignette portal plug-in. So far, Eclipse lags in this arena; I've seen no recent activity in the Eclipse Portlet project. At the other end of the spectrum, if devices are your thing, both NB4.1 and SE7 can be extended to support J2ME development with free downloadable plug-ins.
All three NetBeans environments offer simplified deployment to Web and application servers; but, of course, that's only half the battle. Debugging enterprise apps is ever a sink of time and frustration. Here, SE7 and NB4.1 delight with a debugger that can trace its way all through your applicationyou can even set breakpoints in JSP source files. When it comes to performance analysis, SE7 has a clear advantage: Its method-level profiler/load-tester can generate and record http sessions, let you factor away framework overhead to concentrate on your code, or let you navigate down through your application's EAR or JAR files to select the exact classes or methods on which you want to accumulate data. You can also specify how many simulated user sessions to unleash on your app. It's not exactly Agitar, but it's gratifying to see this level of support for real-world testing bundled into an IDE.
Visualize World UML
No Hack Is an Island
At first blush, NetBeans' chat feature might seem ho-hum to anyone who uses an instant-messaging client. You type text in, click "Send," and your message shows up on the other end. So? Ah, but details matter. For example, what are the odds that everyone on the team favors an IM client compatible with yours? Having it built into the IDE obviates that issue. (Getting an account on a collaboration serverI used share.java .net for testingis a 20-second process.) Too, the code we work on has structure, which IDEs elucidate with color, fonts and indentation. Pasting code into a generic IM client strips out all that formattingnot so with NetBeans. Yes, the client could paste it into his IDE and see the structure, or squint to see it in plain text. But either choice is annoying, and the whole point here is to reduce frictional losses of brainpower and time. Finally, most IM clients limit posting size, for perfectly good reasons. NetBeans may have a limit, but I wasn't able to find it. Your gnarly stack dumps and verbose error chains will come through with a single click. Oh, and you can open public conversations or restrict the chat to only invited guests.
Of course, if you're blipping big chunks of source back and forth, you might as well be considering the files themselves, right? Exactly: Enter collaborative editing. You simply drag files to your collaboration window, and invited participants see them in source editor tabs. All of you can simultaneously edit the filesa form of direct communication that, unlike IM or telephones, leaves useful artifacts on disk when you're done. The IDE ensures that you don't all whack on the same lines at once.
Support and Updates
Which One?
Sun has tacked functionality onto SE7 that flat-out can't be accomplished in NetBeansat least, not yet in NB4.1. In particular, there's no round-trip UML support in NetBeans (a feature also lacking in Eclipse, although third-party plug-ins like Visual Paradigm's Smart Development Environment are available). Profiling and load testing are ready out of the box in SE7, while the NetBeans Profiler Project was still in prerelease status at press time.
Other than that, you're primarily paying for two things: pre-integrated convenience and online support. For example, the collaboration features in NetBeans work fine, but it took me 90 minutes of fiddling to get them installed and operational; with SE7, the menu items were in place when I fired up the box.
Overall, I was impressed with all three productsworthy competitors to IDEA, JBuilder and Eclipse. I found SE7 to be a particularly powerful, no-nonsense solution for building and deploying complex Web and J2EE applications right out of the box, no assembly required. My Aeron chair is going to get a real workout when I ship this stuff back to Sun.
Rick Wayne has way too much fun with Web-enabled ecosystem management software at the University of Wisconsin. E-mail him at fewayne@facstaff.wisc.edu.
| |||||||||||||||||||||