HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
 

Sun's Java WorkShop, the most important product to enter the Java Integrated Development Environment (IDE), is a powerful integrated toolkit that allows quick and easy cross-platform application development in Java. Sun Microsystems, whose JavaSoft group created Java, has taken its time developing this IDE, and poses a serious challenge to Symantec, Borland, Microsoft and other companies who sought to win market share by coming out with a product much faster. Sun's offering is clearly a full industrial strength development tool; however, as with most first release versions, it can be frustrating to the casual developer.

Introduction
Sun's Java WorkShop is a tightly integrated set of tools for creating powerful Java applets and applications. Its goal is to shorten the development cycle for important applications by providing tools that work well together and visually represent the inner workings of Java programs. This makes for extremely rapid program construction and debugging. Further, because Java WorkShop is itself written in Java, there is a level of integration with the applet being developed that no other product can equal. In fact, Java WorkShop being written in Java is its strongest selling point - no other Java IDE provides as smooth an integration with the target application. Java WorkShop makes it easy to switch back and forth between debugging, testing and writing an applet, or even debugging multiple applets at the same time. This is sometimes referred to as the "compile-test-debug" cycle.

Audience
Corporate and commercial developers will love Java WorkShop. It allows for excellent team programming cooperation and rapid application prototyping. Especially for those developers who will be constructing highly complex enterprise applications, Java WorkShop is ideal for two reasons. One, it allows creation and debugging of very complex projects, spanning many source files and even many applications. Further, because it is implemented entirely in Java, Java WorkShop will easily incorporate upcoming APIs for database, commerce, and other applications. Although Java WorkShop is also being marketed as a good choice for individual developers (and is even being offered at a special low price), it lacks the kind of ease-of-use and support that a truly smalltime IDE can offer. However, some small developers may find Java WorkShop ideal, especially if they are engaged in long-term development and seek to compete with larger-scale corporate applications.

Figure 1

Features
Java WorkShop is a Web-based development environment comprised of seven integrated tools, which combine to create a robust programming environment. Each of the tools is outlined here briefly:

  • Project Manager - used to organize various source files into projects for easier management. Lays out directories and HTML files for easy organization and navigation. Also allows you to organize projects into portfolios which simplifies multiple-applet development.
  • Source Editor - Used by various other tools to allow easy editing of Java source code files. Integrates with the debugger for easy stop-point execution. Unfortunately, Java WorkShop lacks some of the color-coding and auto-indentation features that other, smaller, products do so well.
  • Build Manager - Java WorkShop's easy-to-use compile manager. Interfaces nicely with the JDK's Java compiler. Works nicely, but later versions will probably support a JIT compiler as well as other options.
  • Debugger - This is one of the strongest Java WorkShop features. The integrated debugger provides a fantastic analysis of program execution, including thread control, arbitrary breakpoints, and variable inspection. One unique feature of the Java WorkShop debugger is its ability to debug multiple applets or applications running simultaneously - something of which no other IDE can boast.
  • Source Browser - Allows you to explore the structure of your application, including code dependencies and class structure. Although not a unique feature to Java WorkShop, this browser does a very nice job. In addition, the Source Browser can generate JavaDoc (which is used by Sun to create its very own documentation files) help files based on your code, if you follow the proper format.
  • Applet Tester - a seemingly simple feature which can actually save you much time and frustration. Unlike most competing products, Java WorkShop allows you to view and interact with your applets while still within the Java WorkShop environment. This is made possible by the fact that Java WorkShop is itself a Web browser, in addition to a programming environment.
  • Visual Java - One of the most innovative features of Java WorkShop, this tool allows you to visually construct your applet and application Graphical User Interface (GUI). This tool is leaps and bounds ahead of the competition, because it supports features such as relative component placing and event management. Unfortunately, this portion of the Java WorkShop is very unstable and error-prone.

Installation
In Windows95, Java WorkShop installation is very straightforward. Setting up the application for first use is equally simple, as is creating a new project and navigating the sample code that comes with it. On Solaris machines, the process is a bit more complicated, but not extremely so. If you have any problems with installation, your first three calls to SunSoft technical support are free.

Using Java WorkShop
Java WorkShop users will find it both rewarding and frustrating at times. Importing an existing project is relatively easy, although you cannot use the Visual Java tool to modify an existing GUI. To test Java WorkShop's importing abilities, I tried it out on my "CrystalQuest" applet, a great game originally written for the Macintosh.

Setting up the project was relatively easy, as was getting it to run in the Applet Tester. I was able to edit the source and browse the structure of CrystalQuest with relative ease. Especially impressive was the Source Browser - even though I did not use the JavaDoc style of program comments, it still generated a list of constructors and function calls, even detecting overridden functions in parent classes.

Even more impressive was the way in which the debugger handled CrystalQuest. I could directly inspect, pause, resume and kill active threads.

Inspecting variables was a bit more difficult, as was understanding some of the cryptic messages the Exception and Messages panel provided. Overall, though, Java WorkShop's debugger rivals that of any Java IDE, even the powerful Symantec and Borland offerings. Of course, Sun has a tremendous advantage in this area, since the Java debugging protocols are constantly undergoing revision.

Java WorkShop also handled nicely another 'project' of mine that contained several illegal function calls, syntax errors and runtime exceptions. The Applet also had source code that was compiled using the old (1.0) version of the JDK compiler, and contained errors that the old compiler would allow, but should not be allowed under the JDK 1.02 specification. When I attempted to view the applet in the Applet Tester, I received some very cryptic Exceptions. However, when I tried to debug the applet using the Java WorkShop debugger, I was politely informed that the project needed to be rebuilt. Of course, when I attempted to do so, I received some compile-time errors. For each compile-time error, the Java WorkShop Build Manager notified me properly and provided a hyperlink to the problematic line in the source code. This allowed for very easy correction of syntax and illegal function call errors. Exceptions are handled gracefully in the debugger, although with little more explanation than in the normal applet viewer.

Figure 2

Of course, the real challenge was creating a new applet from scratch using Java WorkShop. This is where Java WorkShop shows its greatest potential, but also has its greatest problems. I began with designing a very simple GUI with a few buttons, lists, and tables. This Visual Java handles very nicely. It also allows easy one-click access to all attributes of the AWT Components. The next step was to add a little functionality. For instance, when the user makes a choice using the Choice (pop-down) menu, it should be reflected in a TextField. This, too, was fairly simple, since you can assign intuitive "actions" to various components.

However, this is where Java WorkShop started to break down. If you call for an illegal operation, or pass an invalid operand, Visual Java will cease to function properly. If you persist in trying to develop your applet at this point, nothing but frustration awaits; none of the buttons work properly, and you cannot modify the attributes of any Components. Visual Java also has other drawbacks, most notably that you can only pass constant arguments to "action" functions. Having a button that, for example, toggles the "editable" attribute of a TextField requires custom code. Nevertheless, with a little practice and a little patience, Visual Java can be used to create a terrific GUI applet in very little time. In fact, Java WorkShop's flaws are for the most part minor when compared to its tremendous strengths.

Documentation and Tech Support
Java WorkShop comes only with a small printed booklet outlining its installation procedures. Other, more extensive, documentation is included in electronic form on the product CD. Rudimentary technical support is available online, but it is inadequate for most problems. If you have installation problems, you get three free calls to SunSoft's technical support team, but for more extensive help, you must go to an Authorized Service Provider and contract with them. This can be expensive, and where being a corporation is a big advantage. It should be noted, however, that most of Java WorkShop's features are intuitive enough to figure out by experimentation. Just be prepared to reboot your machine on occaision.

Suggested Improvements
Clearly, Java WorkShop is a work-in-progress. Its tools are highly useful and powerful, but lack some of the refinements that other IDEs have achieved. Java WorkShop is also painfully slow, mainly due to its lack of a Just-In-Time compiler, which should be included in the next release. While still a few releases short of perfection, Java WorkShop is, overall, an excellent development tool.

Conclusion
Every month, Java Developer's Journal presents the JDJ World Class Award to honor the achievement and vision of a single technology developer. Java Workshop 1.0 receives this month's award for its highly innovative and integrated design and tool set. At its best, Java WorkShop is a magnificent tool for developers seeking to do professional-strength development in the hottest, most exciting language available today. It is an ideal choice for a variety of uses, although it tends to be biased towards commercial and corporate developers. Java WorkShop is the only Java IDE written only in Java, compared to C++-based environments outfitted to use Java, such as Symantec's Cafe and Microsoft's Visual J++. With a few relatively minor improvements, Java WorkShop could easily become the de facto industry standard.

About the Author
Eric Ries is the Games and Graphics editor for JDJ. In his spare time, he develops Java applications and writes for books and magazines. He is a founding member of TeamJava, and is doing Intranet development with Pacific Communications Sciences Inc.

 

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.