Java 2 Enterprise Edition technology has been successful in developing enterprise-grade scalable Web applications. However, developing the Web presentation layer (the part of the application that interacts with the browser) has proven a difficult task in J2EE. Macromedia's Dreamweaver (the 2004 Jolt Hall of Fame winner) is still the indisputable king of website content authoring. While it's possible to hook the J2EE back end to the Web presentation layer developed in Dreamweaver, the mixture of Java and non-Java development environments hinders J2EE developer productivity. Java developers need an integrated Web development tool for both Web designers and application developers in a pure Java environment.
Luckily, three new tools do just that: Sun's Java Studio Creator, M7's NitroX for Struts and Genuitec's MyEclipse IDE. All three are built upon popular open source Java IDE platforms (NetBeans and Eclipse). Hence, they already have large potential user bases, can evolve with the underlying IDE, and are licensed under subscription-based pricing schemes. For a yearly subscription fee, developers get a year's worth of free updates. I'll use Dreamweaver as a benchmark in judging features and ease of use, but first, let's review the J2EE Web layer frameworks and the requirements for tools.
Why It's so Difficult
The Model-View-Controller (MVC) design pattern is key to developing maintainable J2EE Web apps. The pattern uses a single Java servlet (the controller) to process all user requests from Java Server Pages (JSPs, the view) displayed on the client browser. The servlet dispatches the required action to the business objects (the model).
Based on the results returned from the model, the controller servlet determines which JSP to display next and forwards the browser to that page. Session JavaBeans are used to store application state information across different layers and pages. The MVC pattern nicely separates the presentation layer from the business layer and lets us manage page navigation rules in the centralized controller.
Although the concept of the MVC pattern is straightforward, the implementation isn't. Developers can roll their own implementations or use one of the MVC frameworks, which are specially designed to formalize the implementation using a design contract and to allow reuse of the key infrastructure code. Using the frameworks helps to keep the code more maintainable for others.
The open source Apache Struts framework is the most widely used MVC framework in today's enterprise Java Web applications. Extending the Struts framework with a UI component model and an event model, the Java Community Process (JSR-127) has defined a new Web presentation framework called Java Server Faces (JSF). JSF borrows many key concepts from the components- and events-based desktop UI APIs to promote code reuse and uses a Struts-like framework to handle inter-component communication. JSF is becoming a standard component in the J2EE specification. Both Struts and JSF define their own JSP custom tag libraries to help generate the HTML code that conforms to the framework requirement. Both frameworks also define configuration files to store navigation rules and other application-specific properties. Given the complexity of those frameworks, good development tools can significantly boost productivity for both novice and expert developers. In fact, the JSF is designed specifically to work with tools.
Key Requirements
What do I expect a good J2EE Web application development tool to do?
- Support standard frameworks. A standard framework--based J2EE application can run on any application server, reducing the risk of vendor lock-in. The JSF is a Java Community Process standard framework. The Apache Struts is a de facto standard because of its wide adoption.
- Support visual editing of Web pages. Any good Web development tool must allow you to visually edit Web pages. The Web pages in J2EE Web applications aren't simple HTML pages—they're JSPs with framework-specific custom tags and dynamic values from JavaBean tags. Supporting a WYSIWYG Web page editor in this environment is a great challenge.
- Automatically generate JavaBean classes for forms, configuration files and other development artifacts. The MVC frameworks (and J2EE in general) use many programming artifacts to glue the system together. For example, each form on a Web page should have an associated JavaBean object to store the user-input values. The configuration files must declare the names and scopes of managed beans in the application and so on. Writing those artifacts by hand not only produces duplicated code but is also prone to inconsistency—it's best to have those files generated by the development tool.
- Support visual editing of navigation rules. Navigation rules is a key component in any MVC framework. They're typically stored in an XML-based configuration file. The tool should visualize and allow developers to edit those rules.
- Support intelligent source code editor. For advanced developers, working with the source code is much more efficient than working with visualized representations or wizards. In the MVC frameworks, there are a variety of source code files to edit: Java source code, JSP code, XML configuration files and so on. The source editors should support syntax highlighting, consistency checking and code completion suggestions.
- Support scalable projects. A key strength of J2EE is its ability to develop highly scalable applications. Visual J2EE IDEs have the unique potential to support both fast prototyping and scaling the prototype application for production use. How did these new IDEs fulfill—or fail—these expectations?
Java Studio Creator
(see ratesheet below)
Based on the open source NetBeans IDE technology, the Java Studio Creator is part of Sun's grand plan for making Java an appealing platform for corporate developers currently using Visual Basic. Built around the JSF technology, it offers a Web development experience similar to that of Microsoft Visual Studio. Since JSF is a relatively new standard, not all commercial J2EE application servers support it. The Java System Application Server Platform Edition 8, which contains the JSF reference implementation, is bundled with the Java Studio Creator. In addition, the JSF framework's scalability in the production environment isn't yet known.
[click for larger image] Visual Editing Sun's Java Studio Creator has a grid-based layout engine that provides control over the accurate placement of the UI components on a canvas. |
The Java source code editor in Java Studio Creator supports real-time syntax-check and code completion suggestions. However, Java source code refactoring is not yet supported, and the JSP and XML editors support only syntax highlighting. The lack of powerful editors might not be a big issue, given the tool's clear focus on rapid visual programming. Also, debugging is supported only on the bundled Sun Java Application Server.
Java Studio Creator is a complete end-to-end visual development tool for rapid development of simple J2EE apps, but version 1.0 sometimes feels unpolished or even buggy. I had difficulties changing bean names or properties and out-of-sync application outlines. Sun is improving this product, however, with frequent updates.
NitroX for Struts
(see ratesheet below)
M7's NitroX for Struts is a plug-in for the open source Eclipse IDE platform that adds Struts and JSP development support to Eclipse while allowing developers to use Eclipse's excellent IDE features, such as team collaboration and test-driven development support. Unlike Java Studio Creator, NitroX targets experienced Java developers with large and complex J2EE projects.
[click for larger image] Error Alerts The NitroX JSP editor makes custom tags, external file names and JavaBean properties available in the code-completion suggestions. If the developer misspells any of these, the editor gives an error or warning. |
The NitroX debugger takes advantage of this deep inspection information, letting developers debug directly against the JSP source. You can step through each line of code in the JSP, access JSP variables at runtime and even step into the Java source code for custom tags. I've found that the debugger works reliably even in large applications with many debugging variables and break points. Furthermore, NitroX lets developers debug on external JBoss, Tomcat, WebLogic and WebSphere application servers.
The NitroX two-way visual JSP editor is also first class. It renders not only HTML tags but also custom JSP tags and JSP includes. The split combo window shows both the designer and the source code editor simultaneously. Numerous wizards are provided to make it easier to insert Struts forms into JSP pages and generate the necessary artifacts. However, since Struts isn't a component-based framework, you still need JSP coding knowledge to work with the designer. NitroX supports a two-way visual designer for the navigation rules in the Struts configuration file. The navigation designer also lets you zoom in or out and specify the levels of actions to display, letting you focus on individual parts of the application as necessary—a nice feature.
Although NitroX itself supports only the Web presentation layer development, you can use other Eclipse plug-ins installed in the same IDE to develop the necessary database, business logic and Web services components that work with the Web layer. For instance, NitroX works with the IBM WebSphere Application Developer IDE, which supports the entire J2EE technology stack on Eclipse. Priced at $499 per user per year, NitroX for Struts is a solid tool that excels in what it does.
MyEclipse IDE
(see ratesheet below)
The MyEclipse IDE consists of a set of commercial and open source Eclipse plug-ins that add some important J2EE development features to the Eclipse IDE: They support JSP, Struts and JSF development in the Web layer as well as database, object-relational mapping and EJB development in the business layer—the whole spectrum of scalable J2EE application development. Instead of writing everything from scratch, MyEclipse takes advantage of Eclipse's modular nature and integrates third-party Eclipse plug-ins into its product to provide an abundance of J2EE features at a low price. However, the plug-ins often have inconsistent qualities and user experiences, and none has a complete view of the entire application. Many Flash-based visual tutorials for MyEclipse are available from the "Tutorials and Demos section of the Eclipse website.
[click for larger image] MyEclipse in Action All editors share a common framework and provide code completion and syntax coloring, outline edit view with insert/delete/move node capabilities, integrated editable properties view, and open-on feature for selected text entity such as linked CSS and JavaScript files. |
A powerful visual editor for the Struts configuration file is supported in MyEclipse. You can edit the file using the pop-up wizards in the outline panel, the visual navigation flow diagram or the XML source editor. The wizards also generate Struts form beans and action classes. The changes made in each panel are synchronized. The JSF configuration file editor, on the other hand, is rudimentary and not very useful.
The debugger lets developers step through JSP source files and monitor all local variables. Be warned that it steps into embedded Java code snippets, but not into custom tag handler objects or JavaBean objects. You can debug on any JSR-045 complement application server, including JBoss, Tomcat, JRun, Sun and WebLogic.
The MyEclipse IDE is licensed at $29.95 per user per year—a far lower price than its competitors. The company provides excellent free support through its discussion forums and has a quick update release cycle of approximately three months. MyEclipse is an excellent choice for experienced developers looking for productivity gains over simple text-based tools or non-J2EE IDEs.
Wrapping It Up
All three IDEs support rapid development of J2EE Web applications based on standard frameworks. The Java Studio Creator best suits corporate developers who want a simplified development process and visual prototyping. NitroX for Struts provides context-aware editors and debuggers for both experienced and novice developers managing complex code bases. Finally, the MyEclipse IDE offers a full range of J2EE tools for experienced J2EE developers at a very affordable price.
One note to end on: While the "code in Dreamweaver was intended to be hidden from the developer, in a Java IDE, the developer must work on the code directly (at least in some cases). Generated code from these tools is all well formatted and relatively easy to read—and in that sense, Java tools are better than Dreamweaver.
Java Studio Creator | |
---|---|
Sun Microsystems 4150 Network Circle Santa Clara, CA 95054 http://www.sun.com/software/products/jscreator/ Pricing Scheme:
System Requirements:
|
|
Rating: 3 stars | The Rate Sheet |
Pros:
|
Cons:
|
NitroX for Struts | |
---|---|
M7 Corp. 20300 Stevens Creek Blvd. Cupertino, CA 95014 www.m7.com Pricing Scheme:
System Requirements:
|
|
Rating: 4 stars | The Rate Sheet |
Pros:
|
Cons:
|
MyEclipse | |
---|---|
Genuitec LLC. 2505 Powderhorn Dr. Plano, TX 75025 www.myeclipseide.com Pricing Scheme:
System Requirements:
|
|
Rating: 3 stars | The Rate Sheet |
Pros:
|
Cons:
|
Dr. Michael Juntao Yuan is an author, developer and software architect for end-to-end software solutions. He is the author of Enterprise J2ME (Prentice Hall, 2003) and Developing Scalable Nokia Series 40 Applications (Addison-Wesley, 2004). Yuan has a Ph.D. from the University of Texas at Austin and works as a research associate at the Center for Research in Electronic Commerce.