Some Notes on Using Rational Rose
Class Diagrams
- Make
sure that you are on Class Diagram: Logical View. If not, use explorer
pane (“Browser”) on left to navigate
- To
Create a Class – click on Class icon on side toolbar; type in name of the
class
- To add
attributes to the class –
- RightClick
on the Class; choose New Attribute
- Type
in the attribute name and type into the selected area.
- Hit
return to create another attribute OR click outside the class to stop
- To add
methods (operations) to the class –
1.
RightClick on the Class; choose New Operation
2.
Type in the method name, argument types and return type into
the selected area.
3.
Hit return to create another operation OR click outside the
class to stop
- With
the class selected, choose Edit \
Diagram Object Properties \ Show Operation Signature to display
parameters for the methods
- To
add links between classes
- First
determine what type of link is needed (Generalization, Aggregation,
Association are major types
- Click
on the icon for the desired link type on the side toolbar
- Click
and Hold on the “from” class
- Drag
to the “to” class
- To
Label the link between classes
- Double
Click on the link
- Look
for the tab for the info you want to change. Common things to want to do
a) put “role” names for each class – done under General tab; b) put
cardinalities for each class – done under Role A detail and Role B Detail
(look for the pull down selection box). Note that in UML the
cardinalities are on the opposite side than connectivities in E/R
diagrams.
Use Case Diagrams
- Make
sure that you are on Use Case Diagram: Use Case View / Main. If not, use explorer pane (“Browser”)
on left to navigate
- First
Actors and Use Cases will be created, then added to the diagram (you could
add them directly to the diagram as we did with Classes in class diagrams
– click on the appropriate icon on the side toolbar, but they (Quatrani)
recommend going through identification and documentation first)
- To
Create an Actor
1.
Right Click on “Use Case View” in Browser pane, and choose New
\ Actor
2.
Type name of actor in the selected area
3.
Repeat for as many times as desired actors.
1.
Right Click on “Use Case View” in Browser pane, and choose New
\ Use Case
2.
Type name of use case in the selected area
3.
Repeat for as many times as desired use cases.
1.
Select a use case in the Browser pane
2.
Go to the “documentation” pane – should be bottom left of the
screen – and type in documentation. (More extensive documentation can be stored
in documents outside of rational rose, with links to the use case RightClick on
the use case in the Browser; select “Open Specification”; Select the Files tab;
RightClick, Choose Insert File; browse to find the appropriate folder and file.
Click Open to open. Click Ok to close the specification)
- To
Create a Use Case Diagram
1.
Make sure that you are on Use Case Diagram: Use Case View /
Main. If not, use explorer pane
(“Browser”) on left to navigate – Double click on “Main” to open it
2.
Drag actor(s) from the Browser pane into the diagram window
3.
Drag use case(s) from the Browser pane into the diagram window
4.
Add links between actors and use cases
- First
determine what type of link is needed (Association and unidirectional
association are major types
- Click
on the icon for the desired link type on the side toolbar
- Click
and Hold on the “from” (actor or use case)
- Drag
to the “to” (actor or use case)
- You
can make additional use case diagrams (for a specific actor). RightClick
on “Use Case View”; choose New Use Case Diagram; type the name of the
actor while the text for name is selected; fill out diagram as before
Sequence Diagrams
- Create
a Sequence Diagram – RightClick on Logical View; Select New / Sequence
Diagram. Then type name of diagram into selected area.
- Double
Click on the icon in the Browser for the sequence diagram in order to open
it
- Drag
initiating actor to the diagram
- Click
on Object icon on side toolbar; click in sequence diagram to place object;
while object rectangle is still selected, type name of object (presumably
a class that you have defined in a class diagram already – could be a
specific object – but usually a class of objects do the same sequence of
actions) (You can also find the class and drag it in – and then the system
knows it is a class)
- Repeat
– bringing in all actors and objects to appear in the scenario
- Add
Messages to the diagram
1.
Decide on message (and type – message to self or Object
Message – message to another object)
2.
Click on appropriate icon on side toolbar
3.
Click on the (time line for the) object or Actor sending the
message and drag to the (time line for) object or actor receiving the message
4.
While the message line is still selected, enter the name of
the message (presumably this should be one of the operations identified in the
class diagram, but no check is done -
you could put garbage in (in fact, your sequence need not make sense either)