Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Symantec's Cafe


May 1996: Symantec's Cafe

If you're looking hard to find a graphical environment to build Java applets

or stand-alone Java applications, Symantec's Café is a good place to

start. Symantec's Café is a full-featured Java development environment

complete with an editor, a compiler, a debugger, a browsing tool, and a visual

class editing tool. Building upon the strength of Symantec's excellent C++ IDE,

Café lets you build Java applets (which are activated within a web page

by Java-enabled browsers such as Netscape's Navigator 2.0 or Sun's HotJava) and

stand-alone Java applications.

To date, tools for developing Java applets and applications have been few

and far between. Sun Microsystems, through its JavaSoft subsidiary, released

the first version of the language and its toolkit, the Abstract Window Toolkit,

in January. Sun also released command-line versions of the Java compiler

(javac), the Java bytecode interpreter (java), and the Java debugger (jdb).

Just as today's typical C and C++ IDEs grew from just a compiler and a

linker on a couple of floppy disks, Java tools will undoubtedly grow in

complexity and comprehensiveness in the coming months and years. With the

release of the beta version of Café, Symantec has achieved an early lead

in this market.

The Café Interface

Users of Symantec C++ will find the Café user interface familiar. A

global menu bar appears at the top of the screen, and a set of tabs allows for

switching between the editing, browsing, debugging, and output workspaces. Each

workspace consists of a set of preconfigured views (windows) and dockable

toolbars that can be customized.

The Café interface veers from the standard Windows look and feel.

Instead of using the Windows Multiple Document Interface model, Symantec

implements a custom window definition in which each view window has a

miniaturized menu bar and the associated close and maximize buttons. The

presentation works well as long as Café is the only application on the

screen. Because the main window always positions itself at the top of the

screen, there's no effective way to have Café and another application

open side by side. This was annoying when I wanted to leave a browser open so I

could refer to the Sun Java documentation while programming.

Like most integrated development environments, application development in

Café is based on the concept of a project file. The project file is a

central repository for the source and library files needed to build the

application, compiler options, and other information about the application

itself. In Café's case, this "other information" includes a pre-parsed

representation of the application's class hierarchy. Café uses this

information to provide access to the class hierarchy of the application under

development.

External libraries containing "unparsed" information can be labeled as such.

Right now, most distributed Java classes include source code, so this feature

may not seem very important. However, it's likely that a strong third-party

market for Java classes and applets will soon appear, just as enthusiastic

third parties extended Visual Basic and Visual C++ with VBXs and OCXs. I

predict that much of Java's strength will be in similar add-on classes and

components, some of which will ship with source code, and others which will

exist simply as class files to retain their proprietary source code.

Building a Java Application

Creating a new application with Café is a three-step process: create

the project; design the user interface; and write the code. First you create

the project file, then you set the project name and location, then you select

the project type (Java console or Java applet). At this point you can request

the services of the Café Application Express.

The Application Express automates much of the set-up work involved with

creating Java applets, single document interface applications, and Java console

applications. After prompting for the application type, it builds the project

file, a pair of resource files, and the Java source file. For Java applets, an

HTML file is also built. In other words, all the parts needed to compile and

run a skeleton application are automatically generated.

You use the Café Studio tool to design the user interface portion of

the application. The tool provides a set of interface options that correspond

to the objects available in the Abstract Window Toolkit, including forms,

menus, buttons, lists, choices, and so forth. The tool generates Java class

definitions to instantiate each item at run time.

After Application Express has built a skeleton application and you've

designed the interface with Café Studio, you must refine the skeleton

into a real application. Java applications typically make heavy use of the

Abstract Window Toolkit, which supplies a spartan set of user interface

classes. Each can be subclassed, so there's no need to build a user interface

item from scratch if it doesn't appear or operate as desired.

However, there's a hitch to subclassing the Abstract Window Toolkit classes:

Sun's designers didn't expose several methods necessary for doing so. I'm not

certain whether this was by design or by omission, but in any case, the

Abstract Window Toolkit does not provide the methods necessary to enhance

classes, for example modifying menu items to include a graphic alongside the

text. If this was a deliberate gesture, it was done so that you could implement

the toolkit's components on top of native window system objects, which do not

accommodate subclassing.

The Abstract Windows Toolkit

Here's an overview of some of the classes you'll find in the Abstract Window

Toolkit. First, the toolkit's Canvas class provides a generic drawing area. You

can use an instance of this class to implement a document for a drawing

program.

The TextField and TextArea classes provide single-line and multiple-line

text editing functionality, respectively. Both were subclassed from the

TextComponent class, which provides selections and notification management

methods. Text of a single font is supported. The Button, Checkbox, and Choice

classes provide push-buttons, check boxes, and combo boxes, respectively. The

List class provides a scrolling array of strings. The MenuBar and MenuItem

classes implement a menu bar and individual menus, respectively.

The Abstract Window Toolkit also provides classes to handle fonts, colors,

bitmapped images, and item layout. The layout classes reduce the amount of work

needed to arrange interface items on a Canvas, eliminating the need to

painstakingly position objects using absolute coordinates. Instead, the

Abstract Window Toolkit layout managers (BorderLayout, CardLayout, FlowLayout,

GridLayout, and GridBagLayout) let you position a component and specify the

distances between it and adjacent components with relative ease.

Before market forces chose the Microsoft Foundation Classes as the

application framework of choice, each C or C++ compiler shipped with some type

of proprietary framework. I expect Java-based toolkits will repeat this

scenario, and we'll see Java vendors enhancing the Abstract Window Toolkit or

providing their own comprehensive alternatives to add value to their tools.

Unlike the compiler-specific toolkits once common in the C++ world, any Java

toolkit should, in principle, work with any Java compiler. This is due to the

portable nature of the Java class files.

Café's Utensils

The code editor. Most of the time you'll spend building an application will

be spent in Café's fast and reliable code editor. It provides multiple

key bindings (emulations are provided for Brief, Microsoft Visual C++, EMACS,

and the Norton editor), configurable keyword coloring, hundreds of levels of

undo, backup control, and multiple selections. A tabbed preference dialog

provides control over nearly every conceivable editing option within its nine

tabs.

The code editor automatically highlights Java and HTML keywords, and I could

customize its keyword table so that it highlighted certain Abstract Window

Toolkit method names. I expect the final version of Café will include

the Abstract Window Toolkit method names in the standard custom keyword table.

Selecting a program entity and clicking the right-mouse button gives a full

selection of options, including the Query Implementors command, which opens the

class editor window.

The class editor. The class editor lists your classes on the left side of

the window, and you can arrange these alphabetically or hierarchically.

Double-clicking on a class lists its methods and data on the right.

Double-clicking on a method or data name displays its corresponding source code

at the bottom. Because the Abstract Window Toolkit is complex but poorly

documented, being able to locate all implementations of a particular method

proves very helpful. The class editor supports common editor functionality,

too, such as the ability to insert and delete classes and member functions.

The hierarchy editor. The hierarchy editor provides the big-picture view,

showing how each class is connected to its superclasses and child classes. You

can print this view if desired. Double-clicking on a class loads it into the

class editor. You can create a new class simply by clicking on a class and

dragging to the right; at which time Café prompts you for the new class

name.

The compiler. Once you've created the application, checking your syntax and

compiling the program is simple. Café invokes Symantec's Java compiler

and presents the compilation results in a text window. This compiler was built

using native code and compiles Java at approximately 18 to 20 times the speed

of Sun's own javac compiler. Compiler output is directed to a window;

double-clicking on an error message opens the file and highlights the line in

error. The compiler fails to properly count the number of source lines though,

reporting "lines processed" as zero, regardless of the amount of code compiled.

This is apparently a bug introduced by Sun; Symantec is aware of it.

Java applications can be run in two different ways, depending on whether

they're applets or stand-alone applications. Café's applet viewer was

supplied by Sun, and is a minimal web page viewer environment for testing

applets designed to be embedded in web pages. Console (stand-alone)

applications can be tested from the command line using Sun's bytecode

interpreter, or run under the control of the Café visual debugger.

The visual debugger. The visual debugger is a welcome replacement for the

simple debugger supplied with Sun's Java development kit. All of the expected

debugging functionality is present, including breakpoints, conditional

breakpoints, single stepping, access to the call stack, and display of variable

values. A special window lists the Java threads of the application.

Web Development--Minus the Web

Although Java is usually thought of as a language for developing Internet

applications, Café doesn't exploit the ability of today's tools to link

directly to the World Wide Web. Café would have been more effective if

it had been endowed with Internet hooks so you could view to web-based

documentation and automatically fetch Java objects from well-known Java

repositories without leaving the development environment. Using your other

Internet browsing tools, though, you can achieve similar functionality.

All in all, Café is an excellent product. Symantec has leveraged a

leading position in the C++ world into a similar position in the emerging Java

community. The ability to buy one package that includes all the tools and

libraries needed to develop Java applets and applications will make the

language more accessible to thousands of today's Visual Basic and C++

programmers.

RATING: * * * *

The Rate Sheet

Pros and Cons

PROS:

  1. Café is the first complete development environment for Java and has

    the technological head start.

  2. It's fairly simple to create applications or applets, especially if you're

    familiar with Symantec C++.

  3. Café's visual Java debugger is a welcome advance over Sun's limited

    command line debugger.

CONS:

  1. Sun's Abstract Windows Toolkit, the basis for the Java objects in

    Café, will appear limited to Microsoft Foundation Classes and Visual

    Basis users.

  2. Café lacks integration with other web browsers and Internet tools.

  3. Due to its interface, Café is hard to use simultaneouslly with other

    application on-screen.

Company Information

Symantec Corp.

10201 Torre Ave.

Curpertino, CA 95014

Tel: (408) 253-9600

Fax: (408) 253-3968

Web: http://www.symantec.com


Price: $299 list, special introductory price $129.95. Upgrade for users

of other Symantec products is $99

Software Requirements: Windows 95 or Windows NT Workstation 3.5x or

above.

Hardware Requirements: Minimum 386; 486 or better recommended.Minimum

8MB RAM; 16MB recommended. Minimum 20MB free disk space; 60MB recommended for

complete installation. VGA or SVGA display. CD-ROM drive mandatory.

Technical Support: 90 days free telephone support.

Money-Back Policy: 60 days.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.