by Ross Mack - GUI Online Productions
What makes a good Java environment, and where can I get one at this hour ?
Shortly after Java became widely available (well, available for download from Sun's overloaded FTP servers) a lot of enthusiasm ensued about the language itself. I remember observing a sort of mania sweep across the development community. There were a lot of beliefs that it would solve many of the ills of the modern development world, all before lunch. Books about the language flourished to the same degree as HTML and other Web references. Some people started use the HotJava web browser and other Browser makers quickly added Java support in their products waiting for the big wave of Java enabled Web sites. All in all there was a large, Sun-lead enthusiasm band wagon for this new language and everyone was willing to get behind it in theory, and a few in practice.
The one item that stunted Java's wide spread adoption in this early period was the complete drought of sophisticated development environments for Java programming. The development community had become used to environments like Delphi, Visual Basic, or at least Visual C++. That is, those who aren't still working on CICS/COBOL. After working with Visual Basic a text editor (even TextPad) and a command line compiler can only look so attractive. Let's not even mention debugging.
Well, the drought is finally over. The first wave (am I mixing my metaphors ?) of Java development environments has shipped, and so has the first wave of patch releases, updates and bug fixes. Let's have a quick look at what's around.
Features, Features, Features
The winner in software is (or, at least, it should be) the product with the greatest number and quality of features delivered. So, how do these tools stack up ? Well, in a lot of ways they all offer similar features, but handle them differently. Let's start at the start, editing the code.
Indeed I have said in the past, and this seems like the perfect place to say it again, 'All I want to work with Java is a syntax highlighting editor and a good class browser.'. Of course, I forgot to mention debugging but we'll just gloss over that for now.
Class browsing is essential in Java development. It's also difficult to get right. I actually believe that ED for Windows includes the best Java class browser of the three products (seems sort of odd, doesn't it ?). It is very visual and gives you a very good feel as to where everything fits in. One of the very cool things about it is that includes everything up to the Object class but only shows you the things that are relevant. It doesn't, for instance, show you all the Container, Panel, AppletStub and other similar classes when all you really want to see is Object/.../Applet/MyApplet. You can double click on it and it will happily bring up the relevant code ready to go. In many ways Visual J++'s Class Browser does most of these things, except the simplicity of the view. For example, J++ tends to show you all the member variables as well, whether or not they are public. I just don't find that useful enough to justify the screen space it chews up.
Symantec's offering, on the other hand is just not as friendly to the way I work. I'm not really sure what it is - it has all the right functionality. But I think the problem is that it is done in three views in one window. One view shows you your classes (relative to packages, not to inheritance), the next shows you member variables and methods which you can expand and collapse, and the third pane shows you the code. The problem lies in the fact that you have to double click on each thing to update the next pane along. Then you start working with that code, you click on something else and when you look back at it after you get distracted by a phone call you can't see how what you have selected relates to the code that is displayed. I guess this is the advantage of popping up a separate code window - it breaks the mental link between editing and browsing.
Also, to view the chain of inheritance in Cafe you need another window again which shows you a highly graphical hierarchy of the classes in your project only. Access to methods, data members and the code behind them is via popup windows in this view. Perhaps the problem I have with Cafe is that there are just too many windows ! Don't get me wrong, once you have done a significant amount of work in Cafe you can get to just the bit of code you want pretty quickly - I just wonder if that is in spite of the environment.
Of course there are likely to be a number of other factors that effect your choice of development tool (and that should never be done purely on the basis of the opinion of some guy who decided to write an article). I will try to cover most of those here - these are things which will apply to one of these products and not to others so there is not necessarily any way to compare them.
I mentioned at the start of this article that Visual J++ ships with support for COM (Component Object Model, Microsoft's way to get objects to talk to one another). This is done through some additional libraries and a tool to build Java interfaces to standard COM objects. This is a very cool feature but at this point it is something of a hack to get it working (sorry, Bill) and can only be delivered to a browser as a signed CAB file because of security restrictions. However, if you want to build conventional applications in Java (not those Web Applet thingys) then this will allow you to use the Java libraries supplied to interface with ODBC, DAO (version 3.0 only at this point), and RDO (version 1.0 only at this point) for pretty cool database access including all the sorts of objects and methods that a Visual Basic programmer who has been using these technologies would expect. Of course J++ ships with examples of Applets that do these things as well as the stock set of samples from Sun.
Obviously ED is a great choice if you want to work in a number of languages and you want to work in the one environment. Web oriented individuals (which tends to include Java programmers) will be pleased to know that the current version of ED also supports Perl and HTML. Of course, by nature ED does not get in the way of the language, it immerses you in it. There is no visual design tool, you will just have to write the code yourself. At least this forces you to learn how to do that correctly and you can experiment with it as you like.
Symantec Cafe provides a visual tool for laying out controls on Applets (or applications) which generates reasonably stock code. Unfortunately it does so with an intermediate step of a resource file, which doesn't get updated when you alter the actual Java code. Then when you go back to modify it in the visual tool, everything is out of sync with how the code actually is now.
Visual J++ uses what is essentially the C++ resource studio and generates Dialog and DialogLayout classes that you can then call from your Applet (or application) to place the controls on them. This is great as it writes a lot of code for you, but you end up with reams of bizarre code that you will probably not understand until you build it yourself anyway.
Both Symantec Cafe and Visual J++ include wizards for building your first Applets. These are great because after about 30 seconds you have a thing that you 'wrote' which runs. ED has no such beast, but what it does have (a feature which I greatly favour over the Wizard approach) is an extensible library of code templates which insert themselves when you start to type them. What I also like is that this can be turned off. This means that you can quickly insert all sorts of useful bits of code (including whole applications and whole applets) very quickly and learn how it works because you are still involved in the writing process. This is also extensible, so you can change or add to the code 'skeletons' that are already there.
So, that's the current state of play in the Java development world (in my not-so-humble opinion). Have a look at each tool before you decide on a Java development tool and keep a look out for new tools from other vendors (Borland, are you still out there ?). But hopefully this has at least given you some introduction into some traps and a few things to look out for. I think choosing a development tool is vital, because let's face it you are going to have to work with it hour after hour after hour ... well, you get the drift.