
|
Visual Cafı 2.0 shows its maturity in the second major release of the product from the Symantec Internet Tools division. While most Java development tools are in their first generation, Symantec continues improving its visual tool for Java. Visual Cafı is available in three flavors for three budgets: Web, Professional, and Database Development editions. I reviewed the Database Development edition (this is DBMS magazine, isnıt it?) and put it to the test.
Visual Cafı adds several new features to version 2.0. Support for the JDK 1.1, specifically the new AWT event model and JavaBeans, is the highlight of the language support. The ability to build Windows 95 and Windows NT executables and incremental debugging is at the top of the list of enhancements. Any programmer will appreciate the lightning-fast compiler included with Visual Cafı, as well as the fast Just In Time (JIT) interpreter. The Database Development edition features the ability to build Java applets and applications in the RAD environment using the wizards and drag and drop; this process was not without some kinks, however. As weıll see later, the use of the database components requires the use of the Symantec middleware server known as dbANYWHERE. While Visual Cafı runs on Windows 95 and Windows NT, there is also a version for Macintosh, although the dbANYWHERE server only runs on the Windows platform.
The installation of Visual Cafı went fairly smoothly, after I worked out a bug in Windows NT. The problem arose from a combination of Windows NT 4.0 with service pack 3 running in True Color video mode. After finding the solution to the problem at the Symantecıs Web site, which involved a Windows NT hotfix, I was ready to install.
Visual Cafı includes a number of different programs as part of its package. I first ran the complete Visual Cafı setup, which included the Java Foundation Classes (JFC), source code, and samples. This process was uneventful, so I moved on to the dbANYWHERE server. You can install direct (native) drivers for many databases, including Oracle 7.x, Microsoft SQL Server 6.5, Sybase SQL Server 10 and 11, Sybase SQL Anywhere 5.x, Informix E/SQL, Microsoft Access 2 and 7, and ODBC. After I pared it down to just the Access driver, the install was a slender 8MB. The only problem I ran into was that there wasnıt a place to install dbANYWHERE as an NT service. That option doesnıt come up until the Service Manager, which comes after the installation program.
Visual Cafı also comes with several third-party software packages that may or may not be useful to you. Visual Page ı Symantecıs HTML editor ı is the most useful bundled application. If you donıt already have Netscape Communicator (essentially version 4 of Navigator), itıs included on the CD-ROM, as a patch to Communicator that makes it fully Java 1.1-compliant. This may not be a factor when you read this, but at press time Communicator 4.03 was not Java 1.1-capable out of the box.
Visual Cafı also includes a version of Sybase SQL Anywhere if you donıt have a database server handy. I preferred to use an ODBC data source for testing the product.
If you still have some space left on your hard drive, thereıs Netscape FastTrack server. Other software on the CD includes: Object Space JGL, a Java library of data structure classes; StarBase Versions, a version-control program; Totally Hip Web Painter, a painting program; and Object Designıs PSE (Persistent Storage Engine) for Java, an entry-level object persistence package. PSE for Java is a potentially useful package, but it isnıt integrated into the Cafı environment.
Visual Cafı is a truly visual Java development environment and a fairly well-rounded product, but it does have some technical drawbacks. You start developing by selecting from a number of default project templates and wizards. The ability to create Win32-native applications and DLLs is appealing to some, but once you select this project type, you might not be able to convert the project to a normal Java program to produce cross-platform Java class files. Java is well-organized and highly structured, yet flexible enough to implement complex tasks. Is Java a replacement for languages like C++? Probably not, but itıs certainly an alternative to Visual Basic.
To create a user interface, you simply click and drag components from the palette onto the form. You can add components from third-party vendors, such as the JFC from JavaSoft, to the palette. As you add components to the form, the program generates the user interface code and inserts it into the Java source file. The Property List window allows you to set properties for the selected component. These properties, of course, vary depending on which component is selected. The components included in Visual Cafı are based on JavaBeans, a component architecture built on Java. Visual Cafı includes more than 100 JavaBeans-compliant components, like a Grid bean and a Calendar bean.
The default method for laying out the components is exact positioning. Alternatively, you can use a layout manager with the visual builder, but the results are less than acceptable. Layout managers are useful for developing applets to deploy through a Web browser because users will have different screen sizes and resolutions ı layout managers will automatically adjust the size and position of components. But using them in Visual Cafı is not easy, so sticking to the exact positioning method is the better option.
Clicking on the MenuBar object in the project window brings up the Menu Designer, a visual designer for the menu created by default for my project. I was able to add more menu options and menu items by clicking the right mouse button at the appropriate location. This Menu Designer is a great tool that complements the rest of the visual environment.
Visual Cafı excels in its ability to bind events generated by one component to another componentıs action. Using the Interaction Wizard on the left side of the Visual Cafı window, you can click on the source component and then on the target component in order to add an interaction between the two. For example, I added a Button and a TextArea to the form. Then I clicked on the Interaction Wizard, clicked on the Button, and clicked on the TextArea, and the dialog in Figure 1 popped up. I decided that the interaction for the Button named "MouseClicked" would "Append string in TextArea." The next dialog allows you to set the property you want changed in the target component. I entered in some text and finished the interaction. Sure enough, when I ran the program the event code had been generated, and clicking on the Button showed the message in the TextArea that I had entered in the Interaction Wizard.
The plague among todayıs development tools, including Visual Cafı, is the necessity for multiple windows. Visual Cafıs project window allows you to see a tree view of the objects in your project and how they are related. To put the visual builder to the test, I added a Panel to the form and dragged the Button and TextArea into the Panel I had just created. The project window immediately recognized that I had added the two components to the Panel and adjusted the tree to reflect this. Among the other tools and windows are a debugger, a break-point editor, a variable, watch and call windows, a class browser, a hierarchy viewer, dbNavigator, and a component library manager. The dbNavigator allows you to browse a database graphically and click and drag a field onto the visual form. You have to use Symantecıs dbANYWHERE in order to use this dbNavigator, and the click and drag functionality uses the proprietary Symantec API, as weıll see later. The class browser is a useful tool for viewing specific parts of the Java code that youıre developing. You simply click on the specific class, method, or variable to see what it is in the code.
The ability to build Java applets and applications visually that are data aware seems too good to be true, but it is very possible with Visual Cafı. There are some limitations and technicalities that you need to know before starting a big project with this productıs database tools. If you canıt accept these, you can still build your database programs with Visual Cafı, but expect to do more coding by hand in lieu of the visual tools.
dbANYWHERE is Symantecıs middleware data engine. It allows you to program applets and applications that use the dbANYWHERE Java API to connect to databases configured with dbANYWHERE. The visual database tools in Visual Cafı use the dbANYWHERE server and API to drive the data aware components included in the product. Realize that the data aware components in Visual Cafı must use dbANYWHERE. You canıt use the visual components with any other middleware system, or with any JDBC driver! dbANYWHERE can use any ODBC datasource, but as noted before, it supports connecting natively to many databases.
To complicate matters further, the dbANYWHERE middleware server also implements the JDBC API along with its proprietary API. (This proprietary API is what the visual components use.) The proprietary API that Symantec has created for this product is far more functional that the JDBC API ı for example, it supports scrollable cursors, whereas JDBC does not. So youıre left to ponder and answer the ubiquitous question in software development: more features but proprietary or fewer features and open standards?
Adding data aware components to your Java applet or application is accomplished with wizards. The dbAware project wizard called by executing the "New Project" option is one way to add database connectivity to your program. I donıt recommend this method for adding a data connection to your project; you should make a project first, then use the Add Table Wizard under the Insert menu. You select a dbANYWHERE server first, then a datasource, then a table in the database, the fields you want to use from the table, the types of components to use for each field in the table, and the functional buttons such as next, back, previous, save, and so forth, and Visual Cafı will add the appropriate components and code to the open form. You can change the layout of the user interface by clicking and dragging the components and add interactions to continue building your application or applet. If youıre not interested in using the wizards though, you might be out of luck. The documentation on the data aware components is sparse if not nonexistent, but with a little tinkering you could figure out how to use the components without the wizards, if you so desired. You must be running the dbANYWHERE server while you are developing and, of course, when you deploy your Java programs.
I consider Visual Cafı to be one of the top three Java development tools on the market, along with Borlandıs JBuilder (see next review in this issue), and IBMıs Visual Age. It is robust in its second major release, and its database tools are fast and usable. The visual tools make it easy to build your programs quickly. The interaction wizard and menu builder are huge time savers. If youıre one of those "old-school" text-editor and command-line programmers, you may want to take a look at Visual Cafı. Building the user interface is the tedious part of programming in Java; Visual Cafı can help you quickly build an interface so you can get on to writing the core of your program. If youıre a visually oriented developer, then you can create intermediate-level projects without writing a line of code
