| OPENBENCH LABS SCENARIO |
Under examination
Java development tools
What we tested
Forte for Java Community Edition
www.ics.com
For more information on Forte, go to: www.sun.com/forte
How we tested
Development workstation running SuSE Linux 7.0 and Windows Me
Key findings
- Forte supports Java, C,C++ and FORTRAN.
- Can create edit and test Java Server Pages (JSP).
- Works with CVS.
- Debugger would freeze on Windows Me.
|
Being built with Java means that it is portable to almost any platform that has a Java Virtual Machine (JVM) and a GUI. Nonetheless, even on an 866-MHz PIII, Forte's actual performance during the development cycle is less than stellar. Of course, this does not affect the run-time performance of the developed applications, which is mostly determined by the quality of the JVM on the target machine.
Forte for Java CE is based on the NetBeans IDE, which is now being managed separately as an Open Source development project at www.netbeans.org. Sun bought two companies, NetBeans and Forte: NetBeans had a sophisticated cross-platform Java development tool and Forte had a very high-end development tool for C and C++. These products have been fused into Sun's primary code base for development tools.
Sun brought them together and used the best of both products to create the Forte IDE, which now supports Java, C, C++, and even Fortran.
We reviewed the Community Edition of Forte for Java (there is another version available). We tested Forte for Java CE on two different platforms: a 500-MHz PIII with 256 MB of memory running SuSE Linux 7.0 and an 866-MHz PIII with 128 MB of memory running Windows Me to test the portable nature of the IDE. (In addition to the Community Edition, an Internet Edition adds the ability to develop Java servlets and database-driven applications.)
To get a good idea of how Forte for Java CE works in a real-world environment, we decided to port the C code for the Open Bench Labs CPU benchmark. The code consists of 34 kernels representing a wide array of computational tasks, both floating point and integer. We also needed to build a GUI to display the results of the benchmark.
We started our testing by creating a project. The project holds information about what Java files make up your application, how you like your windows arranged, and other such administrative items. There are two views you can take of your files. The Filesystem view and the Project view. The Filesystem view shows all the files in a particular directory tree whether they are part of your project or not. The Project view only shows the files that are part of your project.
You mount specific directories in the Filesystem view. We mounted the directory where we wanted to put our Java files and the directory where our old C code resided. This way we could easily access the old code while we were writing the new code.
Next, we created a JFrame component. The JFrame component is represented by a window with a border, title bar, minimize button, maximize button, and close button.
When you create a top-level container using the menus - instead of programmatically - Forte creates a class that inherits from the chosen container and writes the basic code that creates the container and handles a close window event.
Forte then switched us into GUI editing mode, which allowed us to drag and drop components onto our JFrame window (basically a form) and, if we wanted, edit the Java source directly. By default, Forte creates a method named initComponents where it places all of the code for the components you may drag and drop onto the form.
Each time you add a component to your form or change a property of a component or the form itself, this code is rewritten. This is where we found our first problem with Forte. To protect you from writing code and having it overwritten the next time you change the form in the Form Editor, Forte makes the entire initComponents method write-protected in the Source Editor.
Although you can add additional components programmatically in a separate method called from the constructor, we wish there were some way to add components programmatically and have that code incorporated into the initComponents method. If you want to work programmatically with components added through the Form Editor, you can add the code through the Component Inspector's Code Generation tab. Here you will find places to add code before and after component creation, and before and after component initialization. If only this same capability existed for top-level components like JFrame, we would be happy campers.
We completed adding the components that made up our form, a JPanel, a JTable to the JPanel, a second JPanel to the first JPanel and some text boxes and edit fields. The table would hold the results of each individual kernel, while the edit boxes would hold the overall results.
Using the Form Editor, it was easy to arrange our components on the form using various Java layout managers. We did find a few quirks in the Form Editor, but nothing so big as to prevent us from being productive. For instance, there seemed to be a problem with moving some components within a JPanel that was set to the Absolute layout manager. It was very difficult to place the JTable accurately and sometimes it would get clipped.
Once all of our components had been placed on the form, we were ready to port the benchmark kernels. The C code has a file for each kernel, a file for the main program that executes the kernels, a file to analyze the results, and some header files that hold arrays with information that all the kernels need. Since Java is object-oriented, we decided to create an abstract kernel class with all the methods that a kernel needs and have each kernel inherit from the kernel class.
We did away with arrays by placing information such as the the BaseTime constant, which holds the base execution time for the kernel on the reference machine, and the KernelName constant, which holds the name of the kernel, into each kernel class.
We created the class kernel by switching to the project tab in the Explorer view, and right clicking on the project name. This brought up a context sensitive menu where we chose the New/Classes/Class choice. This initiated a dialog where we could specify everything about our class including superclass, implemented interfaces, fields, and methods. Almost anything you would want to do can be done from this dialog. When finished, we clicked on the Finish button and our class was created for us. While this dialog is nice, we are a bit old-fashioned in that we prefer writing the class code ourselves. You can do so by creating an empty file and doing everything manually.
After we had our kernel class the way we wanted, we started to create the individual kernels. We used the dialog to do this because we had thirty-four kernels to port. We didn't want to waste time re-writing very similar code each time.
Since we had previously mounted the directory where our old C code resided, we had easy access for cutting and pasting, which we would do a lot of during the porting process. This process for porting a kernel involved creating a class that inherited from the kernel class, moving the old C code into the bench method, setting the KernelName, BaseTime, and LoopFactor constants, and fixing any syntax errors that arose.
We were lucky that C and Java are very close in syntax and especially lucky that Forte has a decent context-sensitive Source Editor. Forte's Source Editor color-codes Java keywords, literals and strings, and handles indenting. Where appropriate, an auto-completion feature prompts you with object syntax, including method parameters and types. In fact, the Forte Source Editor can even handle HTML code within web or JSP pages.
After cleaning up the most obvious problems with the code for the kernel, Open Bench Labs took a shot at compiling the code. Any syntax errors were noted in the Output window. By double-clicking on the error, the code was highlighted in the Source Editor. Once the errors were fixed and the kernel compiled cleanly, we set out to integrate the first ported kernel into the main Java application.
All we had to do to get the kernel to execute was to add an entry to an array of kernel objects. Then our code was set up to iterate through the array and call the execute method (inherited from the kernel class) of each kernel. After each kernel executes we do some calculations and save the actual time and the base time into a results object.
We had previously created the results class to hold the results of the individual kernel runs and the code to compute the Geometric Mean, Arithmetic Mean, and Confidence intervals.
The Forte development environment showed its mettle during this porting process but not without a hitch. While we like the color-coding done by Forte, the auto-completion help feature is almost more trouble than it's worth.
If you are a novice to the Java language and unfamiliar with classes, fields, and methods available, the auto-completion feature is of invaluable assistance. Assuming it works properly, that is. We, however, ran into a boatload of problems, which took its toll on our code-writing productivity.
The problem with the auto-completion feature is that the list that pops up stays on the screen until you press the escape or enter key.
We think that if you move the cursor out of context and click somewhere else in the document, the list should go away. We discovered a constant annoyance in having to press the escape key each time we wanted to get rid of the list. Fundamentally, the task interrupts the flow of coding. If you bail out of the list at any time - by pressing escape - your place is lost and the auto-completion popup window goes away. You can pick up where you left off by pressing CTRL-SPACEBAR.
Experienced coders, then, might want to turn off the auto-completion feature. It's possible, from the Global Options choice on the Tools menu. If you type quickly enough, the auto-completion feature will not kick in, which is both a blessing and a curse. It's blessing because if you know what you are typing, it doesn't get in your way. It's a curse because if you actually want it to kick in, you have to pause long enough for the popup window to appear, which slows you down. Basically, you learn to live with it and let it help you when it can.
Whether or not you turn off auto-completion, you can use the Object Browser to look at classes and check for parameters and syntax. The Object Browser works fine, but it would be nice if you could use it to paste a prototype for a method call into your code. If you right-click on a method, select cut, and then move to your code and select paste, it pastes the method definition into your code. We are not sure where that behavior would be useful, but we can think of tons of places where pasting a method prototype would.
We ported five or six kernels and decided to do some debugging. Forte has a full debugging environment where you can step through code, set breakpoints, set variable watches, and pretty much anything else you can think of debugging-wise. Overall, we found the Forte debugger adequate for our needs. We did try to set a conditional breakpoint, which the documentation says is possible, but we couldn't get it to work. We used the debugger to step through our code and breakpoints and variable watches to help fix a few run-time bugs.
One thing we found when running under Windows Me was that sometimes the debugger would get confused and the currently executing process would get "detached" and lost. From this point forward, we could not compile the code or execute the application and to fix the problem, we had to reboot our system. If we just exited out of Forte and then ran orte again, it would hang and we would still have to reboot. It seemed to happen when we would execute an application that generated a null pointer exception. It only appears to happen under Windows, not Linux. We wouldn't worry too much about it, but it is something to be aware of.
To check the portability of the code, we moved the project from Windows to Linux system and fired up Forte. When we followed the documentation for importing projects, the environment became screwed up and couldn't import any projects. The only way we were able to get up and running was to create a new project and add the directory that held our application into the new project. This was a result of the differences in directory naming format between Windows and Linux-not unexpected.
This is a minor annoyance since we were easily able to set up the project the way we wanted on Linux from scratch. Once the project was set up, Forte worked the same as it did on Windows. Since Forte is written in Java, it should have the same look and feel on any platform.
One interesting feature of Forte is its ability to create, edit, and test Java Server Pages (JSP) applications. We created a small test application and wrote some JSP code. One unique aspect of Forte is that it has a web server (Tomcat) built into it so you can test your JSP code entirely within the IDE. As we stated before, the Source Editor works with JSP code in much the same way it works with Java code. It has auto-completion for the Java code, as well as JSP directives. You can run the JSP application, but you can't debug it.
Forte is set up to work with the Open Source version control system, CVS. If you have CVS installed on your system, Forte will allow you to mount CVS filesystems and CVS will then control access to the source code. Experienced CVS users will appreciate this feature. With multiple developers working on a project, source control is essential and Forte has you covered.
What's our conclusion about Forte for Java CE? Our feeling are mixed. On the one hand, OpenBench Labs finds that Forte is pretty good for a free Java development system. On the other hand, we recognized some problems that need to be fixed. We imagine that Sun (or the NetBeans.org) will be tackling some of these issues. The good news is that, even if they don't, there is no real problem. Forte, after all, is an Open Source application and it ships with the source code. If any of the disappointments or hitches we have mentioned in this labs review (or any others you find) really bother you, you can fix the problem yourself. The bottom line is that we can recommend Forte, as long as you know that it has a few quirks and foibles.
|