Responsible for this page: Webmaster, carce@ida.liu.se
Page last updated: 2003-08-21
LiU » IDA » TDDB62 » Exercises » UML and Rational Rose
The goal of this exercise is to be able to use Rational Rose to make models. You should get acquainted with how to make use cases, class diagrams and sequence diagrams.
Before you start using Rational Rose, be sure that you are familiar with
the Unified Modeling Language (UML). You can find a description of
UML on these pages:
Your task is to complete the exercises at the end of this page. You do not have to show the result to the lab assistant.
Rational Rose is a CASE tool (Computer Aided Software Engineering), that can be used for modeling using UML diagrams. Modeling is the task of creating a description of a system, to make it possible to understand and communicate how it works. There are several other features in Rational Rose, such as source code generation from models and generation of models from source code. However, in this exercise we will only cover the basics.
Rational Rose is started by the following commands:
module add prog/rose rose
When Rational Rose is started its main window becomes visible. In the left part of it, there is a tree structure which gives a structured view on the currently opened model. Different views in the tree structure is meant to describe different aspects of the modeled system:
Use Case View, shows the functionality of the system as perceived by external actors.
Logical View, shows the internal structure and behavior in the system. This shows how the functionality is designed.
Component View, shows how the system is organized into different code components (such as source code files) and the dependencies between those components.
Deployment View, shows the deployment of the system in the physical world, with nodes such as computers and other devices and the connections between them.
The diagrams and modeling elements you create for a model are located in some of these views. In this exercise, we will only use the Use Case View and the Logical View.
To create a new diagram in a view, right-click on the view folder, select New in the menu that pops up, and finally select the diagram type you want to create. The new diagram is added to the tree structure and you can type in a name for it. As you might have noticed, there are already a few diagrams called Main in the tree structure.
Double clicking on a diagram in the tree structure opens it in the right part of the Rational Rose main window, where it can be edited. Design elements, such as actors, classes and relations, can be added to diagrams by selecting them from the bar in the middle of the main window and clicking where they are to be placed in the diagram. Properties of the design elements can be edited by double clicking the element to bring up a dialog window where changes can be made.
In Rational Rose, design elements are not only parts of diagrams. When a design element is added to a diagram, it is automatically added to the tree structure. The tree structure can be thought of as a repository, where all design elements are available, while each diagram displays a subset of the elements. You can add an existing design element from the tree structure to a diagram by drag-and-drop. This means that each design element can be present in several diagrams, and changing the properties of it at one place, modifies it on all the diagrams. Removing a design element from a diagram is done by clicking it followed by pressing the Del key. However, this does not remove the element from the tree structure or form other diagrams where it is visible. To remove a design element from the tree structure, right click on it and select Delete from the menu that pops up. This will affect all diagrams containing the design element.
More information on how Rational Rose works is available from the Help menu.
Create the following Use Case diagrams in the Use Case View. You should add text descriptions that describes objectives, message-flows between actors and the use case, alternative flows, etc. In Rational Rose, the text descriptions of a use case is entered in a field called "Documentation", which is located in the property dialog of the use case. The property dialog is opened by double clicking the use case.
Create the following Class diagrams in the Logical View.
Create the following Sequence diagram in the Logical View.