FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 2005
Cool Beans

Rick 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 you—and you to it—over 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.


Modeling Included
Here, Java Studio Enterprise 7's UML Diagram window shows the Abstract Factory pattern from the Pattern Repository, to be incorporated into a new UML diagram.

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
Overall, the NetBeans family is a comfy home for a developer, with multiple interacting, dockable windows like any other IDE. You must manage the windows individually, however; there's no analogy to Eclipse perspectives, which is a drawback for the expert and perhaps a lucky stroke for the novice—one less option to worry about. Overall, the IDE sports the expected features: structure-aware code browsers and syntax highlighting, tree-based config dialogs, and hierarchical click-to-reveal code folding and tabs to access files in the source editor. That editor's features chin nicely up to the bar: Autocompletion is practically instantaneous, displaying both completion candidates and their Javadocs in separate, scrollable panes. I do have one beef with both Eclipse and NetBeans: While individual keybindings are easily edited, there's no obvious way to quickly emulate your favorite editor. For example, I'm wired for vi and for the DOS-era BRIEF; I can merely say to JBuilder or Visual SlickEdit, "Make it so!" and it is so. Setting up Eclipse or NetBeans in the same manner would take more fiddling than I'm willing to face. NetBeans' search mechanism is also somewhat less powerful than Eclipse's—for example, you can't restrict a search to member names—although it's easy to find definitions or references of a given Java element. I also missed the browser-like "back" and "forward" buttons found in Eclipse, which let you jump back through the code with a single click.

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.


[click for larger image]
Code Chat
NetBeans 4.1 and Studio Enterprise 7 share useful features for collaborative programming. Here, a code snippet has been pasted into the chat window for all invited participants to see, complete with indentation and syntax highlighting/coloring. Above it is the list of project files, some of which are shared, allowing simultaneous edits by invited users.

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 application—you 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
Along with profiling, Sun's also included a capable round-trip UML 2.0 modeler in SE7 (see "Modeling Included" ). Visual Paradigm sells a competing product as a plug-in for NetBeans. At the top end, you can import entire models from IBM Rational Rose. You can also pull in requirements documents from Telelogic's DOORS or in Embarcadero's XML format. There's also a Design Pattern Catalog pre-populated with EJB 1.1 and 2.0, and Gang of Four patterns; the latter are helpfully organized into behavioral, creational and structural categories, just as they are in the book. While you can't sprinkle Design Pattern Fairy Dust over your project, you can invoke the Apply Design Pattern wizard, which steps you through a process that amounts to almost the same thing. If you wish to create your own UML diagrams from scratch, SE7 boasts a populous toolbar for creating and editing activity, class, collaboration, component, deployment, sequence, state and use case diagrams. Sun even threw in a facility for automatically laying out your diagrams in hierarchies, trees or other shapes. Once your class diagram is to your liking, the IDE can generate Java source code from it; there's also a facility for reverse-engineering diagrams from existing Java code. (I found the process for doing so a tad obtuse, but it is functional.) As you edit either side, the IDE keeps the other in sync. Finally, when your diagrams are ready for debut, you can export them as HTML.

No Hack Is an Island
These days, most programming is done in teams, and team members are less and less likely to inhabit the same building. Yet most of us collaborate with nothing more sophisticated than a revision control system and e-mail. (Brutal use of the former, while ignoring the latter, adds the occasional panicked phone call into the mix.) NetBeans and Java Studio Enterprise, however, provide two novel collaboration features: Code-aware chat and live collaborative editing (see "Code Chat" ).

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 server—I used share.java .net for testing—is 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 formatting—not 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 files—a 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
Books, Web pages and consultants abound to help you with Eclipse, but no one's job depends on it. Likewise with the open source NB4.1. SE7 and Studio Creator come with support from Sun, which starts where the open source products do (that is, an online knowledge base and communities), but extends that with 90 days of installation support and two-day turnaround for online technical support for the duration of your subscription. All three NetBeans-based products have an Update Center function, which contacts Web servers for upgrades and new features; all have a plug-in architecture to allow third-party extensions. All also share a comprehensive help system that can be searched quickly (especially on that Ultra20 box!). Still, one thing is certain: No matter how compelling its feature set, NetBeans has an uphill struggle to garner mindshare (and thus a rich third-party ecosystem) from Eclipse.

Which One?
Java Studio Creator is the obvious choice for its target market: Corporate developers (including less-technically inclined analysts) who want to build Web applications and get them running with a minimum of tinkering. It lacks the heavy-duty software engineering tools like UML support and a Java-method-level debugger. By the same token, there's less to lead a non-engineer astray.

Ultra20 Workstations
Sun's new line of Ultra20 workstations are aimed at serious cycle-suckers who can't affor to simply throw money at performance. With AMD Opteron processors and 7200 RPM SATA disk drives, these machines are downright snappy, and they come with the development tools preinstalled (inlcuding the various servers to test deployment). Sun offers three base configurations: an Opteron 144 (GHz) with 512MB starting at $895, an Opteron 148 (GHz) with 1GB starting at $1,395, and an Opteron 152 (GHz) with 2GB for $2,695. Mine came with Solaris, which was a little confusing to this Linux-and Mac-head. ("What do you mean, I can't just insert a USB jump drive and work with it?") My first impulse when I switched it on was to cover my ears; fortunately, the turbojet-capable fan is variable-speed, and is practically silent in normal operation.

—RW

Sun has tacked functionality onto SE7 that flat-out can't be accomplished in NetBeans—at 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 products—worthy 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.

 

NetBeans-Based IDEs
Sun Java Studio Creator 2004Q2,
Sun Java Studio Enterprise 7, Netbeans 4.1

Studio Enterprise 7 and Studio Creator
Sun Microsystems Inc.
4150 Network Circle
Santa Clara, CA 95054
Tel: (800) 786-0404

NetBeans 4.1

Pricing Scheme: NetBeans 4.1 is a free download; Studio Enterprise 7 costs $1,895 initially, $1,325 for subsequent years' support and maintenance; Studio Creator is $99 per year.

Technical Requirements: A 1GHz minimum processor speed is recommended for all three products; half a gigabyte of memory will work, but a gigabyte would be better. All three run on Solaris, Windows and Linux; NetBeans 4.1 and Studio Creator also run on Mac OS X 10.3 or later.

 

Rating: 4 stars The Rate Sheet
Pros:
  1. Studio Enterprise 7's UML modeling support and advanced enterprise-app profiler streamline construction of complex applications.
  2. Chat and multiuser file editing promote rapid team cooperation.
  3. Studio Creator is probably the fastest way to knock out an enterprise Web application; Studio Enterprise's debugger, profiler and portlet support are standouts for more complex Web apps.

Cons:

  1. There's a lack of strong refactoring support.
  2. There's no means of assembling IDE windows into named arrangements.
  3. The search and code navigation tools are marginally weaker than in competing products.


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.

TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK