Exploring the Repository

In addition to its suite of edit-compile-debug tools, VisualAge for Java provides robust code management facilities. You've seen how easy it is to work with multiple editions of a program element. But what else can you get from the repository?

From the Window menu, select Repository Explorer.

tmemor6.gif (10824 bytes)

The Repository Explorer provides a visual interface to your repository. The repository includes all editions of all program elements. This includes all the program elements that are currently in the workspace.

Within the Repository Explorer, you can open or compare program elements that are stored in the repository. There's no need to swap editions in and out of the workspace to view them or compare them.

By comparing different editions, you can see:

To compare two editions of a package:

  1. Select the Repository Packages page.
  2. Select package in which you created the To-Do List applet from the Package Names list.
  3. From the Editions list, hold down mouse button 1 and drag-select the top two editions. From the Editions menu, select Compare. The Comparing window appears:

    tmemor7.gif (12505 bytes)

  4. Select a class or method name in the Element pane, and you'll see two sets of corresponding code in the text panes below. Here, you can compare the two program elements. From the Differences pull-down menu, you can select Next Difference and Previous Difference. You can also select the arrows:

    in the upper right corner of the window to move back and forth in the list of differences.

All program elements that are in the workspace are indicated by an asterisk (*).

Examining examples in the repository

VisualAge for Java comes with a wide variety of example code. Use the Repository Explorer window to examine these examples. For instance, to examine the completed version of the To-Do List program in the Repository Explorer:

  1. Select the Repository Projects page. Select IBM Java Examples from the Project Names list.
  2. Select an edition from the Editions list and select com.ibm.ivj.examples.vc.todolist from the Packages list. The class in this package appears in the Types list. To examine this class, select it and click mouse button 2. Select Open from the pop-up menu that appears.

Suppose that you want to run these completed samples, or make your own updates to them. First, you must bring them into the workspace. For example, to bring the completed version of the To-Do List program into the workspace:

  1. In the Workbench, select the project into which you want to add the To-Do List program and select Add and then Package from the Selected menu. The Add Package SmartGuide appears.
  2. Select Add packages from the repository.
  3. Select com.ibm.ivj.examples.vc.todolist from the Available package names list. Select an edition from the Editions list and click Finish.

The package for the To-Do List program is added to your workspace, and you can update it and run it.

Summary

With the repository and the ability to work with multiple editions of your program elements, code management becomes easy. VisualAge for Java keeps you on the right track.