Introduction to Object-Oriented Visual Modeling with Rational Rose

 

Overview

Using Rational Rose is a proven way to make software development a whole lot easier. This product has been ranked number one in tool development for quite a few years.

Rational Rose was specifically created to help developers like you build resilient software architectures more easily than ever before.

This means Rational Rose can provide your team with the tremendous power of visual modeling, component-based development and, round-trip engineering, along with unmatched support for the UML and much more.

The core features of Rational Rose are:

 

The Rose Software

After starting the software, you could pick what kind of diagrams to work on:

roseBrowseMenu.jpg (22065 bytes)

 

For class diagram, we could pick either Booch or OMT. We will use Booch as an example.

roseStart.jpg (37121 bytes)

 

Depends on which style you pick, the tool bar will be changed.

roseBooch.jpg (35502 bytes)

 

 

Learn by Example: Class Diagram

1. Pick the class icon on the left in order to draw a Class. Single click will enable you to enter the name of the class. Double click will pop a detail description of the class in form of a window.

class1.jpg (16080 bytes)

 

2. Highlight the class and right click will bring up a pop up menu for entering attribute and operation (method).

class2.jpg (13693 bytes)

 

3. After you enter something, the methods and attributes will show up. Red is operation. Blue is attribute.

class3.jpg (14666 bytes)

 

4. Double click on the class you created will bring you to the "Class Specification for <classname>" window. The tabs on top enabled you to select which features to edit.

class4.jpg (14355 bytes)

 

5. Highlight the operation and double click will pop up the "Operation Specification for <operationName>" window, where you could the operation you just created.

class5.jpg (16666 bytes)

 

6. Use the tool bar on the left and "drag and drop" relationship from one class to another. This one demos the is-a relationship.

class6.jpg (19554 bytes)

 

7. You could also use the has-a relationship

class7.jpg (23539 bytes)

 

8. And the use-a relationship

class8.jpg (25790 bytes)

 

9. A note could be used to show the title of the class diagram

class9.jpg (28519 bytes)

 

 

Learn By Example: Scenario Diagram

0. Now we could move to Scenario Diagram

class10.jpg (10664 bytes)

 

1. Enter a title and pick whether you want "Message Trace" or "Object Message" format. The pattern book used "Message Trace", so we will use "Object Message" for this example. (Remember that Message Trace Diagram or  Object Message Diagram is a Scenario Diagram, it is just two different diagram types.)

class11.jpg (7134 bytes)

 

2. A message diagram with the corresponding tool bar will show up

class12.jpg (15404 bytes)

 

3. Create an "Object" then double click it to get to the "Object Specification" window. You could than pick the class this object belongs to. The class list is obtained from the Class Diagram you just created.

class13.jpg (25391 bytes)

 

4. After you created all the objects you want to work on. You can start creating "object link" from the tool bar. Create an object link between class A and class B whenever class A will call a method in class B. (Note that the format is objectName: ClassName within the object.)

class14.jpg (24060 bytes)

 

5. "Link Message" can then be added from one class to another.

class15.jpg (6280 bytes)

 

6. The direction goes from cliObj to manChatServer. Thus, a mainChatServer method will be called from cliObj. Double click on the "Link Message", and you will be able to pick which method to call. (The method list is picked up from the Class Diagram as well).

class16.jpg (13782 bytes)

 

7. If you think of an additional method you need to add, you could go back to the class diagram to add it. We add the method "openConnection" as an example.

class17.jpg (32475 bytes)

 

8. If you make a mistake in doing the modeling, you have to use the "edit->delete from model" function to get rid of it. A simple Delete will not do it.

class18.jpg (9615 bytes)

 

9. Besides from double click on the "Link Message", you could right click and use the pop up menu to add the method

class19.jpg (5922 bytes)

 

10. Here is a sample Scenario Diagram using Object Message format

class20.jpg (25425 bytes)

 

11. If you want to see the "Message Trace Diagram", there is no need to redraw them. Go to Browse->Create Message Trace Diagram ... and then ...

crtmsg1.jpg (13187 bytes)

 

12. The Message Trace Diagram will be created for you automatically (of course it is based on the Object Message Diagram you just created)

crtmsg2.jpg (33696 bytes)

 

 

Other Functions in Rose

There are MANY other functions available in Rose. For example, while editing the class diagram. The Report menu can help you to show access violations or generate documentation.

menuClass1.jpg (5205 bytes)

 

With class diagram, the tools menu also provide a suite of option such as generating C++, check model, create class using wizard, etc.

menuClass2.jpg (8114 bytes)

 

In doing Object Message Diagram, the report menu can show unreolved objects or messages, and generate documentation.

menuscn1.jpg (5012 bytes)

 

The tool menu also provides a bunch of function as well.

menuscn2.jpg (7671 bytes)

 

At this time, we will only deal with Class and Scenario diagrams. But do remember there is a lot of functions available for you to use in the real world !!! Have fun.