Key concepts

This section gives you the basic definitions that you need to get started.

Development with a repository

Within the VisualAge for Java environment, you do not manipulate Java code files. Instead, VisualAge for Java manages your code in a database of structured objects, called a repository. VisualAge for Java shows code to you as a hierarchy of program elements:

project

   package

      class or interface

         public, default, protected, private methods

Because you are manipulating program elements rather than files, you can concentrate on the logical organization of the code without having to worry about file names or directory structures.

The workspace and the repository

All activity in VisualAge for Java is organized around a single workspace, which contains the source code for the Java programs that you are currently working on. The workspace also contains all the packages, classes, and interfaces that are found in the standard Java class libraries and other class libraries that you may need.

While you work on code in the workspace, the code is automatically stored in a repository. In addition to storing all the code that is in the workspace, the repository contains other packages that you can add to the workspace if you need to use them.

In VisualAge for Java, you can manage the changes that you make to a program element by creating editions of the program element. The workspace contains at most one edition of any program element. The repository, on the other hand, contains all editions of all program elements.

Importing and exporting code

You can easily move your code between your file system and VisualAge for Java. If you want to bring existing Java code into VisualAge for Java, you use the Import SmartGuide to specify files (or whole directory structures) that you want to bring in. VisualAge for Java compiles your code, indicates if there are any errors, and adds the appropriate program elements to the workspace.

When you want to run your program outside of VisualAge for Java, you can export it using the Export SmartGuide. VisualAge for Java creates a Java source (*.java) file or compiled (*.class) file for each class that you export.

The Workbench

VisualAge for Java gives you a variety of ways to examine and manipulate your code using different windows. The primary window you use in VisualAge for Java is called the Workbench. This window displays all of the program elements in the workspace.

twbfull2.gif (11955 bytes)

Tool bar

The Workbench tool bar, which is located below the menu bar, gives you easy access to the tasks you perform most frequently in the Workbench. These tasks include standard editing operations, running, debugging, searching, and manipulating program elements.   Specifically, on the Projects page, from left to right on the tool bar, the tools are: run, debug, search, create program elements such as projects and packages, and show edition information such as 1.0 or 1.1.

Note:
To identify any tool in any of the tool bars in VisualAge for Java, place the mouse pointer over the tool. A label will appear that identifies the tool.

Pages in the Workbench window

Each page gives you a specific viewpoint on the code in the workspace:

Note:
It is important to make a clear distinction between the Workbench and the workspace. The Workbench is a window in the VisualAge for Java user interface. It displays the program elements that are in the workspace.

Visual programming with the Visual Composition Editor

The Visual Composition Editor is the portion of VisualAge for Java where you can develop programs by visually arranging and connecting software objects called JavaBeans, or simply beans. This process of creating object-oriented programs by manipulating graphical representations of components is called visual programming.

Beans

In VisualAge for Java, beans are the components that you manipulate when you program visually. These beans are Java classes that adhere to the JavaBeans specification. In the Visual Composition Editor, you select beans from a palette, specify their characteristics, and make connections between them. Beans can contain other beans and connections to beans. See Support for JavaBeans for more details on the role of beans in VisualAge for Java.

There are two types of beans that you use within the Visual Composition Editor:

A bean's public interface determines how it can interact with other beans. The public interface of a bean consists of the following features:

Connections

In the Visual Composition Editor, connections define how beans interact with each other. You can make connections between beans and between other connections. A connection has a source and a target. The point at which you start the connection is called the source; the point at which you end the connection is called the target.

The Visual Composition Editor

The Visual Composition Editor is the visual programming tool integrated with VisualAge for Java. It is one of the pages in the window that appears when you browse a class.

The Visual Composition Editor is made up of several components: the beans palette along the left side, the status area along the bottom, the tool bar along the top, and the free-form surface where you lay out the beans. In the diagram below, three beans are on the surface: a checkbox bean and two radio button beans.

tvcefull.gif (13869 bytes)

You use the Visual Composition Editor to construct new beans. These new beans can contain other beans as well as connections between beans. You can think of the beans you construct in the Visual Composition Editor as composite beans because they contain other beans. The composite beans you build make up your program.

Beans palette

The beans palette, which is located on the left side of the Visual Composition Editor, contains the set of ready-made beans that you use most frequently. The beans palette organizes the beans into categories.

The Status area at the bottom of the Visual Composition Editor indicates the category and bean currently selected in the beans palette, or the bean or connection currently selected on the free-form surface.

Note:
You can also identify a bean by placing the mouse pointer over the icon for the bean. A label will appear that identifies the icon.

Tool bar

The tool bar, which is located below the menu bar of the Visual Composition Editor, provides easy access to the tools commonly used while manipulating beans. These tools help with such tasks as positioning beans, sizing beans, showing and hiding connections between beans, and testing your program. Specifically, the tools from left to right are: run, specify properties, provide a beans list, show or hide the connections, arrange the beans on on the surface in a number of ways, and debug.

Most of the tools in the tool bar act on the beans that are currently selected in the free-form surface. If no beans are selected for a tool to act on, the tool is unavailable.

Note:
The Tools menu also provides access to these tools.

Free-form surface

The large open area in the Visual Composition Editor is called the free-form surface. You use the free-form surface as the visual programming area where you construct your program. You cannot drop nonvisual beans on top of visual beans.

Regardless of the type of bean, every bean has a pop-up menu that contains options you can use to modify or work with that bean.