Adding Relationships

In this section, we will discuss how you can add Relationships between Artifacts to your Tigerstripe object model using the Class Diagram Editor. Before you can define a Relationship, you first need to understand the types of relationships that are supported by the Class Diagram Editor.

The Class Diagram Editor supports the creation of a number of relationship types. Among the supported relationship types are the five classic UML2.0 relationship types:

In addition to these standard relationship types, there are also a number of type-specific Dependency Relationships that are built into the Class Diagram Editor:

With a combination of the relationship types defined, you should be able to easily model most, if not all, of the relationships you find in your real-world systems.

Note: There is NO support in the Class Diagram Editor for defining custom relationship types that are domain specific.

Defining a Relationship between existing artifacts

The key to defining a relationship between two Artifacts in the Class Diagram Editor is with the Connection Handles. For more information, refer to Working with Tigerstripe Artifacts. There are two Connection Handles that appear when you select an Artifact and rest over that Artifact in the Class Diagram Editor. The Connection Handles appear at the edge of the Artifact Box closest to your cursor position. Once the Connection Handles appear, you can define a relationship between that artifact and another artifact in the diagram. Complete the following procedure to define a relationship between artifacts.

To define a relationship:

  1. Select the arrow for the Connection Handle that matches the direction of the relationship you want to create.
  2. Click and drag the Connection Handle to the Artifact to which you want to create the relationship.
  3. Note: If the cursor appears as an arrow when you are over the top of the second artifact, then you can create a relationship between those two artifacts.

  4. Release the Connection Handle and a list of available relationship types display. This list is similar to what is displayed in the below figure.

If you are unable to create a relationship, your cursor will look like a circle with a slash through it. In this case, releasing the mouse button will not display the list of available relationship types and the Connection Handles will disappear.

The following figure illustrates what the Class Diagram Editor looks like after you create a relationship between two Artifacts. As this figure shows, there are a number of relationships that can be built between these two objects.

Creating a Reference

Defining Relationship Direction

Every relationship has a Direction associated with it. If you look at the arrows in the two Connection Handles from the perspective of the Artifact, that is the Order entity in the figure, you will see that there is one Outbound arrow and one Inbound arrow. For this discussion, we will refer to the artifact for which the relationship is Outbound as the Source of the relationship and the artifact for which the relationship is Inbound as the Target of the relationship.

Note: Whether or not a particular relationship is considered valid between two artifacts may change depending on which artifact is the Source of the relationship and which artifact is the Target.

Defining a Relationship with a new artifact

There is another way to create a Relationship that can be used to create a new artifact in the model while also creating a relationship with the new artifact. Complete the following procedure to create an Artifact and define a Relationship at the same time.

To create an Artifact and a Relationship at the same time:

  1. Select the arrow for the Connection Handle that matches the direction of the relationship you want to create.
  2. Click and drag the Connection Handle to an empty portion of the diagram. That is, the cursor should not be over any existing objects in the diagram. You will know that you can create a relationship when the cursor appears as an arrow.
  3. Release the Connection Handle and a list entries will display. The entries will be similar to the following:
  4. Select an entry from the list. You will be presented with a submenu that lists the types of New objects that you can create a relationship with for the given relationship Type and Direction. An extra entry may also display that will give you the option of creating a relationship of that Type and Direction with an existing entry (Existing Entry).

Now that you know how to build relationships into your model, you have the information you need to complete the diagram for our example system. By adding a few relationships, you can transform the rather static diagram we showed into the following model of our Order Management System:

Completed Example System

As you can see in, the details for the Artifacts that existed in our first image are fully specified (specifically, the various values in the OrderStatus Enumeration artifact) and a few new artifacts have been added to the model. We have modeled the OrderManager as a Session Facade object that manages a list of Orders. We have also defined an OpenOrders Query artifact that is supported by the OrderManager Session Facade artifact. The OpenOrders Query artifact returns a list of open Orders that exist in the system. While this example is by no means complete, it does give you a good idea of the different types of relationships that you can build using the Class Diagram Editor and how those relationships can be used to model real-world systems.

Limitations of Relationships in the Class Diagram Editor

There are several limitations placed on Relationships based on the types of artifacts involved and the context of each of those artifacts. Below is a short list of these limitations:

There are also some basic limitations that exist in the Class Diagram Editor when it comes to Relationships. These limitations include (but are not limited to) the following:

Summary

In this section you were provided with a brief overview of how Relationships are added between Artifacts using the Class Diagram Editor. In the next section (Additional Class Diagram Editor Tools), we will review some of the other tools that are available.

Related Topics

The Class Diagram Editor
Using the Class Diagram Editor
A Class Diagram Editor Overview
Working with Tigerstripe Artifacts

Additional Class Diagram Editor Tools


© copyright 2005, 2006, 2007 Cisco Systems, Inc. - All rights reserved