Together Tutorial
Part 1: Projects and Packages

The scope of the Together Tutorial includes the most commonly used features of Together. We will show you how to construct your own project; the successive lessons will take you through design and implementation. This lesson introduces you to the basics. If you are brand new to Together and think you might have trouble navigating your way around, go through the Together Quick Tour before beginning your work here.

One of the early and continuing hallmarks of Together is its ability to keep class model and code in sync -- all the time, every time. This is what Together calls LiveSourceTM technology. You will get a first look at it here.


Divider line

Creating a new project

Most of the Together Tutorial is centered around this sample problem.

The first step in tackling this problem is to set up a Together project for developing a problem solution.

Step: Create a new Java project named airline.

Open Together and select File | New from the main menu. In the resulting Object Gallery:

  1. Select General from the Categories pane on the left. (General is the default choice.)
  2. Select New Project from the Template pane on the right.

Together displays the New Project dialog box, where you can enter the project name (airline) and the target language (Java). Then click Finish to complete the entire process.

The snapshot below shows the Object Gallery in the background with the New Project dialog box in front.

New project dialog box

Unless you specify otherwise, Together creates a new directory for the new project inside $TOGETHER_HOME$/myprojects. The name of the directory is the same as the project name. Together gives a choice of five languages: Java, VisualBasic, VisualBasic.Net, CORBA IDL, C#, and CORBA IDL. If you want to design only, you can create a language-free project (with Design as the default language).

At a minimum, a project consists of:

When we created our airline project, Together created three files in the primary root directory, airline.

If you are working on a Windows platform, you are likely to see a Windows metafile as well. (You can turn off generating the metafile with the project or default options.)

The User Projects folder in the Directory tab of the Explorer pane corresponds to the physical directory $TOGETHER_HOME$/myprojects. The primary root directory of airline is under User Projects. And since airline is open, its primary root directory appears also under Current Project.

Changing project settings

Together lets users change their working environment options at the default, project, and diagram levels. It also has separate options for the editor. You can change project options any time the project is open.

Step: Change the project options for airline so that the dotted grid does not show on the project diagrams.

To change project options, select Tools | Options | Project Level from the main toolbar. Together opens a dialog box like the one below.

Project options dialog

Expand Diagram to access the Grid options. Unchecking the Show Grid box will hide the grid from view in all project diagrams.

We left the grid off for all of our snapshots. Suit yourself by closing the dialog box with either Ok or Cancel.

Working with the <default> diagram and primary root directory

Together generates a <default> diagram for each new project. The <default> diagram shows packages of the primary root directory as well as classes of any source code files in that directory. (Default diagrams and diagrams for packages have the icon Default diagram icon. They are physical class diagrams.)

When a project is first created, the <default> diagram is simply a blank background. Below are two views of the newly created project in the Explorer pane.

New project directory Directory tab view. The primary root directory (airline) contains no other directories when the project is first created.

The suffix .tpr indicates Together project file. The suffix .tws is for Together workspace settings. All three files are ASCII files.

New project model Model tab view. There is only one part of the model. It contains no elements at the start.

Creating new packages

The <default> diagram is the place to start organizing a project into packages. The airline project will eventually have three packages.

Step: Create a new package named ProblemDomain inside the <default> diagram.

To create a new package, click on the package button (Package button) of the vertical Designer toolbar. Then click on the diagram background. The diagram will get a new node.

At this point, you can edit the package name by typing directly using the in-place editor that is now active. Press Enter to apply the name.

New package

As you make a package, you can see the Together's LiveSource technology go to work -- Together automatically creates a physical directory for the package and generates a default diagram inside the directory. The new diagram will show any physical project content Together finds now or later.

In the Designer pane, the <default> diagram now contains a single node, which is a package. ProblemDomain package
The Model tab of the Explorer pane shows the new Package node. Inside the new package is a node for another diagram, which has the same name as the package. The new package and the new diagram are currently empty. Explorer model view
The Directory tab of the Explorer shows the new file structure of the project.

There is a new subdirectory of the primary root directory named ProblemDomain. That directory now contains the file ProblemDomain.dfPackage, which is the default diagram for the new package.

Explorer directory view

To see the contents of the new ProblemDomain diagram, double click the diagram in the Model tab of the Explorer. Alternatively, use the diagram right-click menu to open the diagram in a new tab.

Step: Create two additional packages in the <default> diagram: UserInterface and DataManagement.

Here is a shortcut for creating multiple packages. Ctrl+Click the package button on the toolbar to keep the button depressed. While the button is depressed, click on the Designer pane, creating packages and renaming them in place without returning to the toolbar for each package.

To release the button, click it again. (If you drop an extra package on the diagram by mistake, the undo button on the main toolbar will remove it.)

Three packages on the diagram and explorer panes

Showing package dependencies

The Designer pane has a vertical toolbar that provides an entire suite of tools for creating UML model elements.

Step: Create a dependency from UserInterface to ProblemDomain.

To create a package dependency, click the dependency button (with the dashed arrow icon, ( Dependency icon ). Then click the dependent package (the "client") in the diagram and drag the end of the arrow to the package that it depends on (the "supplier").

Your dependency should look like the snapshot here.

Button palletIf your toolbar is short, click More buttons (More buttons) at the bottom. Together displays a pallet of the remaining available buttons.

Package dependency

You can use the dependency's inspector to alter its properties, including changing its label, picking a stereotype, and setting the roles of supplier and client. To get the inspector, right-click on the dependency and select Properties from the right-click menu.

Tips and Tricks

Navigation bar

Copyright © 2002 TogetherSoft Corporation. All rights reserved.

Last Revised: Fri, Mar 8, 2002