Professional Documents
Culture Documents
Tutorial
Table of contents
Table Of contents
Table Of contents .......................................................................................................................................... 1
Table of Figures............................................................................................................................................. 6
Table of tables ............................................................................................................................................... 6
Case Study..................................................................................................................................................... 6
Chapter 2 Textual Analysis............................................................................................................................ 6
What is Textual Analysis? ..................................................................................................................... 6
Creating a Document for Textual Analysis............................................................................................ 6
The Textual Analysis Toolbar................................................................................................................ 6
Importing a Text File as the Problem Statement............................................................................ 6
Searching Text in the Problem Statement...................................................................................... 6
Creating a New Candidate Item .................................................................................................... 6
Showing/Hiding a Type of Candidates.......................................................................................... 6
Rearranging the Locations of Candidate Classes .......................................................................... 6
Setting the Textual Analysis Window Layout ............................................................................... 6
Editing the Candidates in Candidate Table.................................................................................... 6
Creating Models for Existing Candidates...................................................................................... 6
Adding Generated Models on Diagrams ....................................................................................... 6
Exercise................................................................................................................................................. 6
Chapter 3 Use Case Diagram ........................................................................................................................ 6
What is a Use Case Diagram? ............................................................................................................... 6
Creating a Use Case Diagram ............................................................................................................... 6
The Use Case Diagram Palette.............................................................................................................. 6
Drawing a Use Case Diagram ............................................................................................................... 6
Creating a Use Case ...................................................................................................................... 6
Creating an Actor .......................................................................................................................... 6
Creating a System.......................................................................................................................... 6
Creating a Collaboration ............................................................................................................... 6
Creating an Association Link ........................................................................................................ 6
Defining the Multiplicity of a Role of an Association Link .......................................................... 6
Creating an <<extend>> Relationship Link .................................................................................. 6
Defining Extension Point .............................................................................................................. 6
Creating an <<include>> Relationship Link ................................................................................. 6
Creating a Generalization Relationship Link ................................................................................ 6
Editing the Use Case Specification ............................................................................................... 6
Editing the Use Case Description.................................................................................................. 6
Performing Textual Analysis with a Use Case .............................................................................. 6
Editing the Actor Specification ..................................................................................................... 6
Scheduling the use cases ............................................................................................................... 6
Generating Sequence Diagram with a Use Case ........................................................................... 6
Example......................................................................................................................................... 6
Exercise................................................................................................................................................. 6
1
Table of contents
2
Table of contents
3
Table of contents
4
Table of contents
5
Table of contents
6
Table of figures
Table of Figures
Figure 2.1 A problem statement having textual analysis performed ............................................................. 6
Figure 2.2 Create Textual analysis by Menu ................................................................................................. 6
Figure 2.3 Create Textual Analysis by Toolbar ............................................................................................. 6
Figure 2.4 Create textual analysis by project explorer .................................................................................. 6
Figure 2.5 A blank new textual analysis document is created. ...................................................................... 6
Figure 2.6 A problem statement .................................................................................................................... 6
Figure 3.1 A use case diagram....................................................................................................................... 6
Figure 3.2 Create new use case using main menu......................................................................................... 6
Figure 3.3 Create use case using toolbar....................................................................................................... 6
Figure 3.4 Create use case using Project Explorer ........................................................................................ 6
Figure 3.5 A blank new use case diagram is created. .................................................................................... 6
Figure 3.6 Maintain Rental Records Use Case.............................................................................................. 6
Figure 3.7 Main Use Cases ........................................................................................................................... 6
Figure 3.8 Create an actor by resource centric .............................................................................................. 6
Figure 3.9 Create another use case................................................................................................................ 6
Figure 3.10 Another Actor............................................................................................................................. 6
Figure 3.11 Generalization of actor............................................................................................................... 6
Figure 3.12 Create an extend use case .......................................................................................................... 6
Figure 3.13 Completed use case diagram...................................................................................................... 6
Figure 3.14 Use Case Scheduling dialog....................................................................................................... 6
Figure 3.15 Justification of Main Rental Recrods......................................................................................... 6
Figure 3.16 Textual analysis.......................................................................................................................... 6
Figure 3.17 Find out candidate use case........................................................................................................ 6
Figure 3.18 A use case diagram .................................................................................................................. 6
Figure 4.1 Sequence Diagram ....................................................................................................................... 6
Figure 4.2 Create sequence diagram using menu bar.................................................................................... 6
Figure 4.3 Create sequence diagram using toolbar ....................................................................................... 6
Figure 4.4 Create sequence diagram using Project Explorer......................................................................... 6
Figure 4.5 A blank new sequence diagram is created.................................................................................... 6
Figure 4.6 Select an actor.............................................................................................................................. 6
Figure 4.7 Sequence Diagram Exercise ........................................................................................................ 6
Figure 5.1 An activity diagram...................................................................................................................... 6
Figure 5.2 Create activity diagram by menu ................................................................................................. 6
Figure 5.3 Create activity diagram by toolbar............................................................................................... 6
Figure 5.4 Create activity diagram by project explorer................................................................................. 6
Figure 5.5 A blank new activity diagram is created. ..................................................................................... 6
Figure 5.6 Initial State................................................................................................................................... 6
Figure 5.7 Create the actor state.................................................................................................................... 6
Figure 5.8 Create the decision point.............................................................................................................. 6
Figure 5.9 Create another decision point....................................................................................................... 6
Figure 5.10 Create another action state ......................................................................................................... 6
7
Table of figures
8
Table of figures
9
Table of tables
Table of tables
Table 2-1 Textual Analysis Palette of VPUML ............................................................................................. 6
Table 3-1 The Use Case Diagram Palette of VPUML................................................................................... 6
Table 4-1 The Sequence Diagram Palette of VPUML .................................................................................. 6
Table 4-2 Message flow of the sequence diagram......................................................................................... 6
Table 4-3 Completed sequence diagram........................................................................................................ 6
Table 5-1 The Activity Diagram Palette of VPUML..................................................................................... 6
Table 6-1 Objects of the diagram .................................................................................................................. 6
Table 6-2 Messages if the diagram................................................................................................................ 6
Table 7-1 The State Diagram Palette of VPUML.......................................................................................... 6
Table 7-2 Transitions table ............................................................................................................................ 6
Table 9-1 The Component Diagram Palette of VPUML ............................................................................... 6
Table 10-1 Deployment Diagram Palette ...................................................................................................... 6
Table 14-1 The Print Preview Toolbar .......................................................................................................... 6
10
Case Study
Case Study
Power Driver is a vehicle rental company. Power Driver has 105 branches over the world. Currently
there is no linkage between these branches. Power Driver needs a computer system to connect all these
branches together to support better services to the customer in a more efficient way. Following are the
requirements of the computer system.
The system should be able to store the vehicle records. A vehicle record includes model number, serial
number, status, booking schedule and booking history. The status of the vehicle should be available, rented,
repairing or reserved. Staffs only allow in searching the vehicle records. Only the branch’s manager allows in
maintaining vehicle records. The system stores the customer records. The customer record includes name, ID,
status and rental history. The status of the customer can be normal, VIP or suspend. The normal and VIP
customers can rent vehicles but suspended customers are not allowed to rent vehicles. All staffs can maintain
customer records. But only the branch’s manager allows changing the status of the customers. Each branch
has one manager.
The system should provide a function for staffs to input the rental record. The staff can only create the
rental record for the car in his own working branch. The staff cannot create a rental record for other branches.
After the vehicle is returned, the staff needs to update the rental record. The system should have a reserved
car function for booking the car. The start of the booking period should be within next 7 days. Normal staff
cannot make a booking request to another branch. Only the manager can request a booking to another branch.
The staff can use the system to check the availability of the car by using model number, or booking
schedule. If there are suitable car(s) for renting, the staff can use the system to reserve or rent the car. If the
car is rented, other staffs should not rent the car to another customer until the rental period is over. The staff
can search the customer records by using customer’s name, ID or telephone.
The system should provide a report generation function to generate a monthly report of the branch.
11
Chapter 2 Textual Analysis
12
Chapter 2 Textual Analysis
13
Chapter 2 Textual Analysis
Method 2 – Creating a blank new textual analysis document using the toolbar
2. Click on Create Textual Analysis on the pop-up menu. A blank new textual analysis document appears.
14
Chapter 2 Textual Analysis
Method 3 – Creating a blank new textual analysis document using the Project Explorer
1. Right click on the Textual Analysis directory in the Project Explorer. A pop-up menu appears.
2. Click on Create Textual Analysis on the pop-up menu. A blank new class diagram appears.
15
Chapter 2 Textual Analysis
16
Chapter 2 Textual Analysis
1. Click on Import Text File on the toolbar. An Open dialog box appears.
2.Select the text file that contains the problem statement. Click on the Open button in the dialog to import the
file. The problem statement is imported to the text pane.
17
Chapter 2 Textual Analysis
2.Input the desired text in the input dialog. Click on Find button in the dialog. If the text is found, the text
will be highlighted.
18
Chapter 2 Textual Analysis
1. Click on the Add Candidate button on the textual analysis toolbar. A cascading menu appears.
19
Chapter 2 Textual Analysis
2.Click on the Add text as Class, Add text as Actor, Add text as Use Case or Add text as Work Flow
button on the cascading menu. An input dialog appears. (If you select a phrase in the text pane, the input
dialog will not appear. The selected phrase will be the candidate.)
3.Input the candidate name. Click on the OK button in the input dialog. The input dialog is close. The
candidate is added to the candidate pane and all the occurrences of the candidate in the text pane are
highlighted in green.
20
Chapter 2 Textual Analysis
2.Drag the word or phrase to the candidate pane. A new candidate class is added to the candidate pane. All
the occurrences of the candidate are highlighted (occurrences of the most recently candidate added are
highlighted in green and the other candidate occurrences are highlighted in yellow.
21
Chapter 2 Textual Analysis
22
Chapter 2 Textual Analysis
3. Click on Add text as Class button on the popup menu. The candidate is added to the candidate pane.
23
Chapter 2 Textual Analysis
2. Click on Add Candidate button on the popup menu. A cascading menu appears.
24
Chapter 2 Textual Analysis
5. Click on the OK button in the input dialog. The new candidate is added to the candidate pane.
25
Chapter 2 Textual Analysis
1. Click Show/Hide Candidate Classes button to show or hide the candidate classes.
26
Chapter 2 Textual Analysis
2. Click Show/Hide Candidate Actors button to show or hide the candidate actors.
3. Try other Show/Hide Candidate button to show or hide the other type of candidate items.
27
Chapter 2 Textual Analysis
1. To rearrange candidate classes in the candidate pane, right click on the container. A pop-up menu appears.
2. Click on Cascade Layout button on the popup menu. The locations of candidate classes were rearranged.
28
Chapter 2 Textual Analysis
Title Layout
To rearrange candidate classes in the candidate pane, right click on the container. A pop-up menu appears.
Click on the Title Layout button on the popup menu. The locations of candidate classes were rearranged.
29
Chapter 2 Textual Analysis
1. Click on the Hide Text Area button on the textual analysis toolbar. The text area is hidden.
30
Chapter 2 Textual Analysis
2.Click on the Show Candidate Class Table Only button on the textual analysis toolbar. Only the
candidate class table is shown in the textual analysis window.
3.Click on the Show All View button on the textual analysis toolbar. All the panes are shown in the
textual analysis window.
31
Chapter 2 Textual Analysis
32
Chapter 2 Textual Analysis
4. Rename the candidate name. Press Ctrl + Enter to finish the operation.
33
Chapter 2 Textual Analysis
5.To change the type of the candidate, click on the cell in the Type column in the candidate table. A list of
types is shown.
34
Chapter 2 Textual Analysis
7. To edit the description of a candidate, click on the cell in the Class Description column.
35
Chapter 2 Textual Analysis
36
Chapter 2 Textual Analysis
2. Click on the Create Class/Actor/Use Case/Work Flow Model button in the popup menu.
37
Chapter 2 Textual Analysis
38
Chapter 2 Textual Analysis
5. Click on the Model Tree View tab in the Project Explorer. The generated models are shown.
39
Chapter 2 Textual Analysis
40
Chapter 2 Textual Analysis
41
Chapter 2 Textual Analysis
Exercise
Perform textual analysis on the problem statement below.
Power Driver is a vehicle rental company. Power Driver has 105 branches over the world. Currently there
is no linkage between these branches. Power Driver needs a computer system to connect all these branches
together to support better services to the customer in a more efficient way. Following are the requirements of
the computer system.
The system should be able to store the vehicle records. A vehicle record includes model number, serial
number, status, booking schedule and booking history. The status of the vehicle should be available, rented,
repairing or reserved. Staffs only allow in searching the vehicle records. Only the branch’s manager allows
maintaining vehicle records. The system stores the customer records. The customer record includes name,
ID, status and rental history. The status of the customer can be normal, VIP and suspend. The normal and VIP
customers can rent vehicle but suspended customers are not allow to rent a vehicle. All staffs can maintain the
customer record. But only the branch’s manager allows changing the status of the customer. Each branch has
one manager.
The system should provide a function for staffs to input the rental record. The staff can only create the
rental record for the car in his own working branch. The staff cannot create a rental record for other branch.
After the vehicle is returned, the staff needs to update the rental record. The system should have a reserved
car function for booking the car. The start of the booking period should be within next 7 days. Normal staff
can not make a booking request to another branch. Only the manager can request a booking to another
branch.
The staff can use the system to check the availability of the car by using model number, booking schedule.
If there are suitable car(s) for renting, the staff can use the system to reserve or rent the car. If the car is rented,
other staff should not rent the car to another customer until the rental period is over. The staff can search the
customer records by using customer’s name, ID or telephone.
The system should provide a report generation function to generate a monthly report of the branch.
42
Chapter 3 Use Case Diagram
43
Chapter 3 Use Case Diagram
44
Chapter 3 Use Case Diagram
Method 2 – Creating a blank new use case diagram using the toolbar
1.Click on the Create Use Case Diagram button on the toolbar. A blank new use case diagram
appears.
45
Chapter 3 Use Case Diagram
Method 3 – Creating a blank new use case diagram using the Project Explorer
1. Right click on the Use Case Diagram directory in the Project Explorer. A pop-up menu appears.
2. Click on the Create Use Case Diagram. A blank new use case diagram appears.
46
Chapter 3 Use Case Diagram
47
Chapter 3 Use Case Diagram
2. Rename the newly created use case. Press Ctrl + Enter to finish the operation.
48
Chapter 3 Use Case Diagram
1. Click on an existing actor on the diagram. Resource icons appear around the actor.
2. Press on the Association -> Use Case resource icon . A new use case appears.
3. Drag the use case to the desired location. Release the mouse button.
4. Rename the newly created use case. Press Ctrl + Enter to finish the operation.
49
Chapter 3 Use Case Diagram
50
Chapter 3 Use Case Diagram
Creating an Actor
Method 1 – Creating an actor using the Use Case Diagram Palette
1.Click on the Actor button on the Use Case Diagram Palette. Click on the desired location on the
diagram. A new actor appears.
2. Rename the newly created actor. Press Ctrl + Enter to finish the operation.
2. Press on the Association -> Actor resource icon . A new actor appears.
51
Chapter 3 Use Case Diagram
3. Drag the actor to the desired location. Release the mouse button.
4. Rename the newly created actor. Press Ctrl + Enter to finish the operation.
Creating a System
You can create one and only one system on a use case diagram.
52
Chapter 3 Use Case Diagram
1.Click on the System button on the Use Case Diagram Palette. Click on the desired location on the
diagram. A new system appears.
2. Rename the newly created system. Press Ctrl + Enter to finish the operation.
53
Chapter 3 Use Case Diagram
3. Click on the use case once so that the system contains the use case.
It is suggested that a system boundary should be created before creating use cases of the
system. If the use cases are created in the system boundary, the system boundary will
contain the use cases. If the system boundary does not contain a use case, drag the use case
in the system boundary to make the system boundary contains the use case.
It is not allowed to create more than one system on a use case diagram. A warning dialog
box is shown when you try to create more than one system on a use case diagram.
54
Chapter 3 Use Case Diagram
Creating a Collaboration
Method 1 – Creating a collaboration using the Use Case Diagram Palette
1.Click on the Collaboration button on the Use Case Diagram Palette. Click on the desired location
on the diagram. A new collaboration appears.
2. Rename the newly created collaboration. Press Ctrl + Enter to finish the operation.
2. Press on the Generalization -> Collaboration resource icon . A new collaboration appears.
3. Drag the collaboration to the desired location. Release the mouse button.
55
Chapter 3 Use Case Diagram
4. Rename the newly created collaboration. Press Ctrl + Enter to finish the operation.
1.Click on the Association button on the Use Case Diagram Palette. Drag from either the actor or
the use case to the target diagram element.
2. Release the mouse button. A new association is created between the diagram elements.
56
Chapter 3 Use Case Diagram
1.Click on an existing diagram element listed above on the use case diagram. Resource icons appear around
the diagram element.
2.Press on the Association -> Use Case resource icon (Note: Click association -> actor
resource icon for creating association between actors, or between use case and actor). A new diagram
element appears.
57
Chapter 3 Use Case Diagram
3. Drag the new diagram element to the target diagram element. The target diagram element is selected.
4. Release the mouse button. The association link is created between the diagram elements.
1. Right click on an existing association link on the diagram. A pop-up menu appears.
58
Chapter 3 Use Case Diagram
4.Choose one of the multiplicities (0, 0..1, 0..*, 1, 1..*, *, Unspecified, Other…) on the cascading menu.
Then the multiplicity of the role is set.
59
Chapter 3 Use Case Diagram
5. Repeat the above steps to set the display the multiplicity cascading menu for Role B(xxx).
6. Choose Other… on the menu to specify the multiplicity of the use case. An input dialog box appears.
7. Input the multiplicity of the role such as 0..n. The multiplicity of the other role is set.
60
Chapter 3 Use Case Diagram
1.Click on the Extend button on the Use Case Diagram Palette. Drag from a use case to the other
use case.
2. Rename the newly created <<extend>> relationship link. Press Ctrl + Enter to finish the operation.
Method 2 – Creating an <<extend>> relationship link using the resource centric interface
61
Chapter 3 Use Case Diagram
1. Click on an existing use case on the diagram. Resource icons appear around the use case.
2. Press on the Extend -> Use Case resource icon . A new use case appears.
3. Drag the new use case to the target use case. Release the mouse button.
62
Chapter 3 Use Case Diagram
6. Rename the <<extend>> relationship link. Press Ctrl + Enter to finish the operation.
7. Drag the <<extend>> relationship name and move it to the desired location.
63
Chapter 3 Use Case Diagram
2. Check the Extension Point checkbox. The extension point of the base use case appears.
=>
64
Chapter 3 Use Case Diagram
3.Click on the extension point. A text box appears. Rename the extension point. Press Ctrl + Enter to finish
the operation.
65
Chapter 3 Use Case Diagram
1.Click on the Include button on the Use Case Diagram Palette. Drag from a use case to the other
use case.
2. Rename the newly created <<include>> relationship link. Press Ctrl + Enter to finish the operation.
Method 2 – Creating an <<include>> relationship link using the resource centric interface
1. Click on an existing use case on the diagram. Resource icons appear around the use case.
66
Chapter 3 Use Case Diagram
2. Press on the Include -> Use Case resource icon . A new use case appears.
4. Release the mouse button. A new <<include>> relationship link is created between the use cases.
Method 1 – Creating a generalization relationship link using the Use Case Diagram Palette
67
Chapter 3 Use Case Diagram
1.Click on the Generalization Relationship button on the Use Case Diagram Palette. Drag
from the source diagram element to the target diagram element.
2. Release the mouse button. A new generalization relationship link is created between diagram elements.
Method 2 – Creating a generalization relationship link using the resource centric interface
1.Click on an existing diagram element (actor or use case) on the diagram. Resource icons appear around the
diagram element.
68
Chapter 3 Use Case Diagram
4.Release the mouse button. The new generalization relationship link is created between the diagram
elements.
69
Chapter 3 Use Case Diagram
1. Right click on an existing use case on the diagram. A pop-up menu appears.
2.Click on Open Specification on the pop-up menu. The Specification dialog box appears. The properties
such as name, priority rank, stereotype and so on can be modified in the dialog box.
70
Chapter 3 Use Case Diagram
3.Click on the Use Case Description tag. The use case description of the use case appears. (Read the
Editing Use Case Description with a Use Case section for more details.)
71
Chapter 3 Use Case Diagram
2. Click on the Use Case Description on the popup menu. The use case description of the use case appears.
72
Chapter 3 Use Case Diagram
3.To change the template of the use case, click on the Available Template combo box. Select the desired
template in the combo box.
4. The template of the use case description is changed. Select the Main template again.
73
Chapter 3 Use Case Diagram
5. To add a new item in the template, click Add Item button in the dialog. An input dialog appears.
6. Input the item name in the input dialog box. Click OK button to finish the operation.
74
Chapter 3 Use Case Diagram
7. To rearrange the items of the template, click the Move Up button and Move Down button.
75
Chapter 3 Use Case Diagram
9. To edit the flow of events in the use case description, click on the Value column of the Flow of Event item.
Click on the table in the Value column to insert a new Actor Input or System Response.
76
Chapter 3 Use Case Diagram
10. After editing a new Actor Input, a new input row will automatically added in the table.
11. Click on the table to adding a new System Response. Then click OK button to finish editing the use case
description.
77
Chapter 3 Use Case Diagram
78
Chapter 3 Use Case Diagram
4. Click on the Create Textual Analysis. The textual analysis window appears.
79
Chapter 3 Use Case Diagram
5.Find out the nouns in the problem statement. Drag the candidate classes to the Candidate Class Container.
The candidate classes are highlighted. (See Chapter 1 - Textual Analysis for more details)
80
Chapter 3 Use Case Diagram
2.Click on Open Specification. The specification dialog box appears. You can modify the actor’s properties
in the specification dialog box.
81
Chapter 3 Use Case Diagram
2. Click on Use Case Scheduling on the pop-up menu. The Use Case Scheduling dialog box for the use
case diagram appears. It shows a list of use cases on the diagram.
3. Click on a cell in the Rank column of the table. A pull-down box appears.
82
Chapter 3 Use Case Diagram
4.Choose one of the priority categories for the use case. Then the priority is set for the use case. Prioritize
other use cases in the table.
83
Chapter 3 Use Case Diagram
5. Click on a cell in the Justification column to input the justification for the priority setting.
6.Click on the Fit Selected Row Height button to adjust the row height (or click on the Fit All Rows Height
to adjust the heights of all the rows).
84
Chapter 3 Use Case Diagram
7.Click on the Rank column heading, the use case will be sorted. The use cases can be sorted in either
ascending or descending order with the priority ranking.
85
Chapter 3 Use Case Diagram
2.Click Generate Sequence Diagram in the popup menu. A new sequence diagram (System level) will be
generated according to the flow of events defined in the use case description of the use case.
86
Chapter 3 Use Case Diagram
Example
1.Click on the Use Case button on the Use Case Diagram Palette. Click on an empty area on the use case
diagram. A new use case appears. Rename the use case as “Maintain Rental Records”.
2.Repeat the steps above to create more use cases with the names: Issue Vehicle Rental, Maintain Rental
Records, Maintain Vehicle Records and Maintain Customer Records and Analyze Rental Report.
87
Chapter 3 Use Case Diagram
3.Click on the use case named as Issue Vehicle Rental. Resource icons appear around the use case. Click on
the Association -> Actor resource icon. A new actor appears. Drag it to a desired location and
rename it as “Staff”.
4.Click on the use case named as Maintain Rental Records. Resource icons appear the use case. Click on the
Association -> Actor resource icon. A new actor appears. Drag the new actor to the actor named
as Staff. An association relationship link is created between the actor and the use case.
88
Chapter 3 Use Case Diagram
5.Repeat the steps above to create a new actor as “BranchManager” and create association relationship links
between the actor and the use cases with the names: Maintain Rental Records, Maintain Customer Records
and Analyze Rental Report.
89
Chapter 3 Use Case Diagram
6.Click on the actor named as Staff. Resource icons appear around the actor. Click on the Generalization
-> Actor resource icon. A new actor appears. Drag the new actor to the BranchManager actor. The
new actor disappears. Then a generalization relationship link is created between the actors.
90
Chapter 3 Use Case Diagram
7.Click on the use case Issue Vehicle Rental. Resource icons appear around the use case. Click on the
Extend -> Use Case resource icon. A new use case appears. Drag the new use case to the desired
location. Rename the use case as “Request Other Branch for Vehicle Rental”. Then the new use case
becomes extension use case.
91
Chapter 3 Use Case Diagram
8.Create an association relationship between the actor named BranchManager and the use case named
Request Other Branches for Vehicle Rental. Then rearrange the diagram elements.
92
Chapter 3 Use Case Diagram
9.Right click on the use case named Issue Vehicle Rental. A pop-up menu appears. Check Extension Point
on the pop-up menu. The extension point of the use case appears. Click on the extension point. A text box
appears. Rename the extension point as “vehicle available”.
10. Double-Click on the extension link. A text box appears. Rename the link as “(available vehicle) [request
other branch for vehicle rental]”.
93
Chapter 3 Use Case Diagram
11. Click on the system button on the Use Case Diagram Palette. Click on the use case diagram. A system
boundary appears. Rename the system as “Vehicle Rental System”. Drag the use cases into the system
boundary to make the system boundary to contain the use cases.
94
Chapter 3 Use Case Diagram
12. Right click on an empty area on the diagram. A pop-up menu appears. Click Open Specification on
the pop-up menu. The use case diagram specification dialog box appears. Click on the Schedule tab.
A list of use case is shown.
13. Set the priorities of the use cases and input the justifications for the priorities. Then click OK to exit the
dialog box.
95
Chapter 3 Use Case Diagram
14. Right click on the use case named Maintain Rental Records on the use case diagram. A pop-up menu
appears. Click Sub Diagrams. A cascading menu appears. Click Textual Analysis. A cascading menu
appears. Click Create Textual Analysis. A blank textual analysis document is opened. Input the
following text in the document.
Maintain Rental Records
Flow of events
2. The system validates the staff identity with user name and password
3. After validation, the staff can maintain the rental records. The staff can query, insert, update or archive the
rental records.
96
Chapter 3 Use Case Diagram
15. Perform textual analysis with the statements. Find out all candidate use case, actor and class in the
statements and add them to the Candidate Container. (Read the Textual Analysis tutorial for more
details.)
97
Chapter 3 Use Case Diagram
Exercise
Draw the diagram below according to the guidelines given in this chapter.
98
Chapter 4 Sequence Diagram
99
Chapter 4 Sequence Diagram
100
Chapter 4 Sequence Diagram
101
Chapter 4 Sequence Diagram
102
Chapter 4 Sequence Diagram
103
Chapter 4 Sequence Diagram
Creating an Actor
Method 1 – Creating an Actor using the Diagram Palette
1.To create an actor in your sequence diagram, click on the Actor button on the diagram palette and
click on the desired location on diagram. A new actor is created.
2. Rename the newly created actor name. Press Ctrl + Enter to finish the operation.
104
Chapter 4 Sequence Diagram
Double-click on the toolbar button to set the button as default on the toolbar.
(Press Escape or click on any other button to de-select)
1. Click on an existing object on the diagram. Resource icons appear around the object.
105
Chapter 4 Sequence Diagram
2. Press one of the resource icons with Object ( , ). A new actor appears.
106
Chapter 4 Sequence Diagram
Creating an Object
Method 1 – Creating an Object using the diagram palette
1.Creating an object in your sequence diagram, click on the Object button on the diagram palette and
click on the desired location on the diagram. A new object appears.
2. Rename the newly created object. Press Ctrl + Enter to finish the operation.
107
Chapter 4 Sequence Diagram
Creating a Message
Method 1 – Creating a message using the diagram palette
1. Click on the Message button on the diagram palette.
2. Click anywhere on the message sender, and drag to the target diagram element.
When message is being dragged, a new focus of control will create. There are two methods to maintain the
message connected to the same focus of control and not to create a new one.
1. Drag the message with a little of distance each time.
2. Press the Shift button when dragging the message.
108
Chapter 4 Sequence Diagram
Creating a Constraint
Method 1 – Creating a Constraint using the diagram palette
1. Click on the Constraint button on the diagram palette.
2. Click anywhere on the source diagram element. Drag to the target diagram element.
3. Input the constraint in the text field. Press Ctrl + Enter to finish the operation.
109
Chapter 4 Sequence Diagram
3. Rename the newly created duration message. Press Ctrl + Enter to finish the operation.
110
Chapter 4 Sequence Diagram
2. Click on an existing object or the focus of control that you want to create self message.
3. Press F2 to rename the self message. Press Ctrl + Enter to finish the operation.
111
Chapter 4 Sequence Diagram
3. Press F2 to rename the newly created create message. Press Ctrl + Enter to finish the operation.
112
Chapter 4 Sequence Diagram
Creating a Concurrent
Method 1 – Creating a concurrent using the diagram palette
1. Click on Concurrent button on the diagram palette.
113
Chapter 4 Sequence Diagram
3. Rename the newly created concurrent. Press Ctrl + Enter to finish the operation.
Creating a Recursive
Method 1 – Creating a recursive using the diagram palette
1. Click on Recursive button on the diagram palette.
114
Chapter 4 Sequence Diagram
3. Rename the newly created recursive. Press Ctrl + Enter to finish the operation.
115
Chapter 4 Sequence Diagram
Creating a Subsystem
Method 1 – Creating a Subsystem using the diagram palette
1.Creating a subsystem in your sequence diagram, click on the Subsystem button on the diagram
palette and click on the desired location on the diagram. A new subsystem appears.
2. Rename the newly created subsystem. Press Ctrl + Enter to finish the operation.
116
Chapter 4 Sequence Diagram
2.Click on Open Specification on the pop-up menu. The Specification dialog box appears. The name,
description and so on can be modified in the dialog box.
117
Chapter 4 Sequence Diagram
2.Click on Open Specification on the popup menu. A Specification dialog appears. The name, description
and so on can be modified in the dialog.
118
Chapter 4 Sequence Diagram
119
Chapter 4 Sequence Diagram
120
Chapter 4 Sequence Diagram
3. Click on Base classifier, a list will be display showing all the class in the current project.
4.Click on an existing class or click on Create Class to create a new class. Click on Create Class, the Class
Specification dialog appears. Setting the new class property, then click OK button.
121
Chapter 4 Sequence Diagram
2.Click on Select Class on the popup menu. A submenu appears. Click on Create Class to create a new class
or click on an existing class. To search a class, enter the class name in the Search textfield.
122
Chapter 4 Sequence Diagram
123
Chapter 4 Sequence Diagram
124
Chapter 4 Sequence Diagram
1.Open a collaboration diagram from the Project Explorer. Double click on a blank place on the diagram to
generate a new sequence Diagram.
125
Chapter 4 Sequence Diagram
=>
126
Chapter 4 Sequence Diagram
Example
1.Click on the Actor button on the toolbar and click on the desired location on diagram. A new actor is
created.
2. Rename the newly created actor as “Customer”. Press Ctrl + Enter to finish the operation.
Î Î
3.Select the newly created actor, the resource icons appear around it. Press Actor Resource icon, and then
drag to right side and release the mouse button. A new actor is created.
Î Î
127
Chapter 4 Sequence Diagram
4.Double-click the newly created actor and rename it as “Staff”. Press Ctrl + Enter to finish the operation.
Press the Object Resource icon, and then drag to the right side and release the mouse button to create a
new object. Rename the newly created object as “Vehicle Rental System”.
5. Double click on the Customer to Staff message. A textfield appears, input “rent a vehicle”.
6. Double click on the Staff to Vehicle message. A textfield appears, input “validate customer by id”.
128
Chapter 4 Sequence Diagram
7.Create a message form “Vehicle Rental System” to” Staff”. Rename the newly created message as
“customer is valid”.
8.Right click on the “customer is valid” message. A popup menu appears. Select “return” to change the
message type.
129
Chapter 4 Sequence Diagram
130
Chapter 4 Sequence Diagram
Exercise
Draw the following diagram according to the guidelines given in this chapter.
131
Chapter 5 Activity Diagram
132
Chapter 5 Activity Diagram
133
Chapter 5 Activity Diagram
1. Click on Create Activity Diagram on the toolbar. A blank new activity diagram appears.
134
Chapter 5 Activity Diagram
1. Right click on Activity Diagram directory in the Project Explorer. A pop-up menu appears.
2. Click on Create Activity Diagram on the pop-up menu. A blank new activity diagram appears.
135
Chapter 5 Activity Diagram
136
Chapter 5 Activity Diagram
Signal Sending A signal that may trigger a transition to another state in its
state machine when sent.
Object
Object Flow A variety of control flow that represents the relationship
between an object and the object, operation, or transition that
creates it or uses it.
137
Chapter 5 Activity Diagram
2. Rename the newly created action state. Press Ctrl + Enter to finish the operation.
138
Chapter 5 Activity Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the Action State resource icon . A new action state appears.
3. Drag the action state to the desired location. Release the mouse button.
139
Chapter 5 Activity Diagram
4. Rename the newly created action state. Press Ctrl + Enter to finish the operation.
2. Rename the newly created sub activity. Press Ctrl + Enter to finish the operation
140
Chapter 5 Activity Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the sub activity resource icon . A new sub activity appears.
3. Drag the sub activity to the desired location. Release the mouse button.
4. Rename the newly created sub activity. Press Ctrl + Enter to finish the operation.
141
Chapter 5 Activity Diagram
2. Rename the newly created initial state. Press Ctrl + Enter to finish the operation.
2. Rename the newly created final state. Press Ctrl + Enter to finish the operation.
142
Chapter 5 Activity Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the final state resource icon . A new final state appears.
3. Drag the final state to the desired location. Release the mouse button.
4. Rename the newly created final state. Press Ctrl + Enter to finish the operation.
143
Chapter 5 Activity Diagram
2. Rename the newly created horizontal synchronization. Press Ctrl + Enter to finish the operation.
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
144
Chapter 5 Activity Diagram
2. Press on the horizontal synchronization resource icon . A new horizontal synchronization appears.
3. Drag the horizontal synchronization to the desired location. Release the mouse button.
4. Rename the newly created horizontal synchronization. Press Ctrl + Enter to finish the operation.
145
Chapter 5 Activity Diagram
2. Rename the newly created vertical synchronization. Press Ctrl + Enter to finish the operation.
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
146
Chapter 5 Activity Diagram
2. Press on the vertical synchronization resource icon . A new vertical synchronization appears.
3. Drag the vertical synchronization to the desired location. Release the mouse button.
4. Rename the newly created vertical synchronization. Press Ctrl + Enter to finish the operation.
2. Rename the newly created decision point. Press Ctrl + Enter to finish the operation.
147
Chapter 5 Activity Diagram
z Sub Activity
z Horizontal Synchronization
z Vertical Synchronization
z Decision Point
z Signal Receipt
z Signal Sending
z Object
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the decision point resource icon . A new decision point appears.
3. Drag the decision point to the desired location. Release the mouse button.
4. Rename the newly created decision point. Press Ctrl + Enter to finish the operation.
148
Chapter 5 Activity Diagram
2. Rename the newly created signal receipt. Press Ctrl + Enter to finish the operation.
1.Click on any existing diagram elements listed above on the diagram. Resource icons appear around the
diagram element.
149
Chapter 5 Activity Diagram
2. Press on the signal receipt resource icon . A new signal receipt appears.
3. Drag the signal receipt to the desired location. Release the mouse button.
4. Rename the newly created signal receipt. Press Ctrl + Enter to finish the operation.
150
Chapter 5 Activity Diagram
2. Rename the newly created signal sending. Press Ctrl + Enter to finish the operation.
1.Click on any of the existing diagram elements listed above on the diagram. Resource icons appear around
the diagram element.
2. Press on the signal sending resource icon . A new signal sending appears.
151
Chapter 5 Activity Diagram
3. Drag the signal sending to the desired location. Release the mouse button.
4. Rename the newly created signal sending. Press Ctrl + Enter to finish the operation.
152
Chapter 5 Activity Diagram
Creating an Object
Method 1 – Creating an object using the Activity Diagram Palette
1.Click on the object button on the Activity Diagram Palette. Click on the desired location on the
diagram. A new object is created.
2. Rename the newly created object. Press Ctrl + Enter to finish the operation.
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
153
Chapter 5 Activity Diagram
3. Drag the object to the desired location. Release the mouse button.
4. Rename the newly created object. Press Ctrl + Enter to finish the operation.
154
Chapter 5 Activity Diagram
Creating a Transition
Method 1 – Creating a transition using the activity diagram palette
You can create transition between diagram elements listed below in the activity diagram.
z Action State
z Sub Activity
z Initial State (Note: Cannot be the target diagram element)
z Final State (Note: Cannot be the source diagram element)
z Horizontal Synchronization
z Vertical Synchronization
z Decision Point
z Signal Receipt
z Signal Sending
z Object
1.Click on the transition button on the Activity Diagram Palette. Drag from the source diagram element
to the target diagram element.
2. Release the mouse button. A new transition is created between the diagram elements.
155
Chapter 5 Activity Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2.Press on the any resource icon with transition (, , , …). A new diagram element appears. (Note:
You must choose the resource icon correspondent to the target diagram element)
3. Drag the new diagram element to the target diagram element. The target diagram element is selected.
4. Release the mouse button. The transition is created between the diagram elements.
156
Chapter 5 Activity Diagram
1.Click on the object flow button on the Activity Diagram Palette. Drag from the source diagram
element to the target diagram element.
2. Release the mouse button. A new object flow is created between the diagram elements.
157
Chapter 5 Activity Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the object flow to object resource icon . A new diagram element appears.
3. Drag the new diagram element to the target diagram element. The target diagram element is selected.
4. Release the mouse button. The object flow is created between the diagram elements.
158
Chapter 5 Activity Diagram
Creating a Swimlane
1.Click on the swimlane button on the Activity Diagram Palette. Click on the desired location on the
diagram. A new swimlane appears.
159
Chapter 5 Activity Diagram
2. Rename the newly created object. Press Ctrl + Enter to finish the operation.
160
Chapter 5 Activity Diagram
Example
1. Click on the Initial State button on the Activity Diagram Palette. Click on the desired
location on the diagram. A new initial state appears.
2. Click on the initial state. The Resource icons appear around the initial state. Click on the
Transition -> Action resource icon. A new action state appears. Drag the action state to the
desired location. Rename it as “Validate Customer”.
3. Click on the action state. Resource icons appear around the action state. Click on the
Transition -> Decision. A new decision point with a transition appears. Drag the decision
point to the desired location.
161
Chapter 5 Activity Diagram
4. Click on the decision point. Resource icons appear around the decision point. Click on the
Transition -> Decision resource icon. A new decision point with a transition appears. Drag
the decision point to the desired location. Double click on the transition that between the
decision points. A text box appears. Rename the transition as “[invalid customer]”.
5. Click on the lastly created decision point. Resource icons appear around the diagram element.
Click on the Transition -> Action resource icon. A new action state with a transition appears.
Rename the new action state as “Register Customer”. Rename the transition between the new
action state and the decision point as “[register]”.
162
Chapter 5 Activity Diagram
6. Click on the lastly created decision point. Resource icons appear around the diagram element.
Click on the Transition -> Final State resource icon. A new final state with a transition
appears. Drag the final state to the desired location, and rename the transition that between the
decision point. Rename the final state as “[exit]”.
163
Chapter 5 Activity Diagram
7. Click on the Initial Sate button on the Activity Diagram Palette. Click on the desired location on
the diagram. A new initial state appears. Click on the new initial state. Resource icons appear
around the initial state. Click on the Transition -> Action. A new action state appears. Drag the
new action state to the Register Customer action state. A transition is created between the new
initial state and the Register Customer action state.
164
Chapter 5 Activity Diagram
Exercise
Draw the diagram below according to the guidelines given in this chapter.
165
Chapter 6 Collaboration Diagram
166
Chapter 6 Collaboration Diagram
167
Chapter 6 Collaboration Diagram
168
Chapter 6 Collaboration Diagram
1. Right click on Collaboration Diagram directory in the Project Explorer. A pop-up menu appears.
2. Click on Create Collaboration Diagram. A blank new collaboration diagram appears.
169
Chapter 6 Collaboration Diagram
170
Chapter 6 Collaboration Diagram
171
Chapter 6 Collaboration Diagram
Creating an Object
Method 1 – Creating an Object using the Diagram Palette
1.Click on Object button on the Diagram Palette and click on the desired location on diagram. A new
object is created.
172
Chapter 6 Collaboration Diagram
2. Rename the newly created object. Press Ctrl + Enter to finish the operation.
1. Click on an existing actor. The resource icons appear around the diagram element.
3. Drag the object to the desired location. Release the mouse button.
173
Chapter 6 Collaboration Diagram
4. Rename the newly created object. Press Ctrl + Enter to finish the operation.
Creating an Actor
Method 1 – Creating an actor using the Diagram Palette
1.To create an actor in your collaboration diagram, click on the Actor button on the Diagram Palette
and click on to the desired location on diagram. A new actor appears.
2. Rename the newly created actor name. Press Ctrl + Enter to finish the operation.
174
Chapter 6 Collaboration Diagram
1. Click on an existing object. The resource icons appear around the diagram element.
3. Drag the actor to the desired location. Release the mouse button.
4. Rename the newly created actor. Press Ctrl + Enter to finish the operation.
175
Chapter 6 Collaboration Diagram
Creating a Package
Method 1 – Creating a package using the Diagram Palette
1.To create a package in your collaboration diagram, click on the Package button on the Diagram
Palette and click on to the desired location on diagram. A new package appears.
2. Rename the newly created package name. Press Ctrl + Enter to finish the operation.
Creating a Subsystem
Method 1 – Creating a subsystem using the Diagram Palette
1.To create a subsystem in your collaboration diagram, click on the Subsystem button on the Diagram
Palette and click on to the desired location on diagram. A new subsystem appears.
2. Rename the newly created subsystem name. Press Ctrl + Enter to finish the operation.
176
Chapter 6 Collaboration Diagram
2. Rename the newly created classifier role name. Press Ctrl + Enter to finish the operation.
Creating a Link
Method 1 - Creating a link
1. Click on Link button on the diagram palette.
177
Chapter 6 Collaboration Diagram
1. Click on the object. The resource icons appear around the object.
3. Drag the actor to the target diagram element. The target diagram element is selected.
4. Release the mouse button. A link is created between the object and the actor.
178
Chapter 6 Collaboration Diagram
z Classifier Role
1. Click on the classifier. The resource icons appear around the classifier.
3. Drag the classifier to the target diagram element. The target diagram element is selected.
4.Release the mouse button. An association role is created between the ClassifierRole1 and the
ClassifierRole2.
179
Chapter 6 Collaboration Diagram
Creating a Message to
3. Rename the newly created message to. Press Ctrl + Enter to finish the operation.
180
Chapter 6 Collaboration Diagram
3. Rename the newly created message from. Press Ctrl + Enter to finish the operation.
181
Chapter 6 Collaboration Diagram
2.Click on Reorder Messages… on the popup menu. The Collaboration Diagram Specification dialog
appears. A list of messages is shown with their sequence number.
182
Chapter 6 Collaboration Diagram
4. Click Move Up / Move Down in the popup menu. The message will be moved up or down
5. Click on the Reset Sequence Number in the dialog. The sequence numbers of the messages are updated.
183
Chapter 6 Collaboration Diagram
6.Click on the OK button. The dialog is closed. The sequence numbers of the messages on the diagram are
updated.
Creating a Swimlane
Method 1 - Creating a swimlane
It is suggested that the swimlane should be created before any other diagram elements in
collaboration diagram. It is because the swimlane is a containment diagram element, if any
other diagram elements are created before the swimlane, these diagram elements may need
to relocate. Once the diagram element is contained by swimlane, when the swimlane is
moved, all the diagram elements contained by the swimlane will be moved too.
184
Chapter 6 Collaboration Diagram
The first created swimlane is always placed on the top of the diagram, and the second
created swimlane will be placed under the first created swimlane, and so on. You can move
the swimlane up or down by dragging the swimlane over the swimlane bar.
3. Rename the newly created swimlane. Press Ctrl + Enter to finish the operation.
If you want to resize the swimlane, you can move the cursor over the edge on the swimlane
bar. Then drag it to the appropriate size you want and release the mouse.
185
Chapter 6 Collaboration Diagram
1. Click on the generalized actor. The resource icons appear around the actor.
3. Drag the actor to the target diagram element. The target diagram element is selected.
4.Release the mouse button. A generalization relationship is created between the generalized actor and the
specialized actor.
186
Chapter 6 Collaboration Diagram
2.Click on Open Specification. The properties of the object can be modified using the object specification
dialog box.
187
Chapter 6 Collaboration Diagram
2.Click on Open Specification. The actor specification dialog box appears. The properties of the actor
specification can be modified using the actor specification dialog box.
188
Chapter 6 Collaboration Diagram
1.Open a collaboration diagram from the Project Explorer. Double click on a blank place on the diagram to
generate a new sequence Diagram.
189
Chapter 6 Collaboration Diagram
=>
190
Chapter 6 Collaboration Diagram
Example
1.Click on the Swimlane icon on the toolbar, and then click anywhere in the diagram. A swimlane appears in
the diagram.
2. Rename the newly created swimlane as “Actor”. Press Ctrl + Enter to finish the operation.
191
Chapter 6 Collaboration Diagram
3.Click on the Swimlane icon on the toolbar to create three more swimlane(s) on the diagram. Name it
as “UI”, “Control” and “Model”. The diagram will look as follow.
4. Click on the Actor button on the toolbar, and then click on the Actor swimlane. An actor is created.
5. Rename the newly created actor name as “Customer”. Press Ctrl + Enter to finish the operation.
192
Chapter 6 Collaboration Diagram
6. Click on the Actor button on the toolbar to create another actor as “Staff”.
7. Click on the Link button on the toolbar. Press on “Customer” and then drag to “Staff” to create a link.
8.Click on “Staff”, the resource icons appear around the “Staff”. Click on the Object icon , drag to “UI”
swimlane to create an object.
193
Chapter 6 Collaboration Diagram
10. Right click on the mouse button on the “Search Vehicle UI”. A pop-up menu appears.
194
Chapter 6 Collaboration Diagram
11. Click on Open Specification, the object specification dialog box appears.
12. Click on the Stereotype pull-down box, choose boundary. Then click OK to close the dialog box.
195
Chapter 6 Collaboration Diagram
13. The Interface of “Search Vehicle UI” will change as the following figure.
14. Press on the Object icon , drag to Control swimlane to create another object.
196
Chapter 6 Collaboration Diagram
15. Rename the newly created object as “Rental Vehicle Control”, and then right click on it to open the
object specification dialog box.
16. Set the Stereotype type as control. Then click OK to close the dialog box.
197
Chapter 6 Collaboration Diagram
17. The interface of the “Rental Vehicle Control” will change as the following figure.
18. According to the following table, create other objects on the diagram.
198
Chapter 6 Collaboration Diagram
20. Click on the Message To icon on the toolbar. Then click on the link which is between Customer and
Staff.
199
Chapter 6 Collaboration Diagram
22. According to the following table, create the message to and message from on the diagram.
200
Chapter 6 Collaboration Diagram
201
Chapter 6 Collaboration Diagram
Exercise
Draw the following diagram according to the guidelines given in this chapter.
202
Chapter 7 State Diagram
203
Chapter 7 State Diagram
204
Chapter 7 State Diagram
205
Chapter 7 State Diagram
1. Right click on Create State Diagram directory in the Project Explorer. A pop-up menu appears.
2. Click on Create State Diagram. A blank new state diagram appears.
206
Chapter 7 State Diagram
207
Chapter 7 State Diagram
208
Chapter 7 State Diagram
209
Chapter 7 State Diagram
210
Chapter 7 State Diagram
2. Rename the newly created initial state name. Press Ctrl + Enter to finish the operation.
211
Chapter 7 State Diagram
Creating a State
Method 1 – Creating a state using the diagram palette
1. Click State button on the diagram palette and click on the desired location. A new state is created.
2. Rename the newly created state. Press Ctrl + Enter to finish the operation.
212
Chapter 7 State Diagram
1. Click on an existing initial state. The resource icons appear around the diagram element.
2. Press on the mouse button on the State icon . A new state appears.
4. Rename the newly created state, and press Ctrl + Enter to finish the operation.
213
Chapter 7 State Diagram
2. Rename the newly created concurrent state. Press Ctrl + Enter to finish the operation.
214
Chapter 7 State Diagram
2. Rename the newly created submachine state. Press Ctrl + Enter to finish the operation.
215
Chapter 7 State Diagram
2. Rename the newly created call state. Press Ctrl + Enter to finish the operation.
216
Chapter 7 State Diagram
2. Rename the newly created action state. Press Ctrl + Enter to finish the operation.
217
Chapter 7 State Diagram
2. Rename the newly created junction point name. Press Ctrl + Enter to finish the operation.
218
Chapter 7 State Diagram
2. Rename the newly created state dynamic choice point name. Press Ctrl + Enter to finish the operation.
Method 2 – Creating a State Dynamic Choice Point using the resource centric
interface
Diagram elements that a state dynamic choice point can be created from, using the resource centric interface
are:
z State
z Concurrent State
z Submachine State
z Call State
z Action State
z Initial State
z Junction Point
z State Dynamic Choice Point
z History State
z Synch State
z Vertical Synchronization Bar
z Horizontal Synchronization Bar
z Stub State
219
Chapter 7 State Diagram
2. Rename the newly created history state name. Press Ctrl + Enter to set the history state name.
220
Chapter 7 State Diagram
Creating a Transition
Method 1 – Creating a transition using the diagram palette
You can create transition between diagram elements listed below in the state diagram.
z Initial State
z State
z Final State
z Junction Point
z Dynamic Point
z History State
z Vertical Synchronization Bar
1. To create a transition in your state diagram, click on the transition icon on the diagram palette and
click on the source diagram element.
221
Chapter 7 State Diagram
222
Chapter 7 State Diagram
223
Chapter 7 State Diagram
2. Press on the mouse button on the include icon . A new state appears.
3. Drag the new state to the desired location. Release the mouse button.
224
Chapter 7 State Diagram
2. Rename the newly created synch state name. Press Ctrl + Enter to finish the operation.
225
Chapter 7 State Diagram
2. Rename the newly created vertical synchronization name. Press Ctrl + Enter to finish the operation.
226
Chapter 7 State Diagram
z History State
z Synch State
z Vertical Synchronization Bar
z Horizontal Synchronization Bar
z Stub State
2. Rename the newly created horizontal synchronization name. Press Ctrl + Enter to finish the operation.
227
Chapter 7 State Diagram
228
Chapter 7 State Diagram
2. Click on Open Specification. A state specification dialog box appears. The name and other related
information in the General tab can be modified in the state specification.
229
Chapter 7 State Diagram
Example
1. Click on the initial state button on the toolbar, and then click to the desired location. A new initial
state appears.
2. Select the newly created initial state, the resource centric is displayed. Then click on state icon and drag to
the desired location.
4. Click the state button on the tool bar to create one more state.
230
Chapter 7 State Diagram
6. Select the Not Available state, and then select the resize box.
231
Chapter 7 State Diagram
8. Click on the state button on the toolbar, and then click inside the “Not Available” state.
232
Chapter 7 State Diagram
233
Chapter 7 State Diagram
10. Then create two more states inside the “Not Available state” and rename them as “Rented” and “Booked”
respectively.
11. Select the “Available” state, and then press on the state icon on the resource centric.
234
Chapter 7 State Diagram
235
Chapter 7 State Diagram
236
Chapter 7 State Diagram
16. Click on Open Specification. The transition specification dialog box appears.
17. Enter “send to repairing” in the Name field and click OK.
237
Chapter 7 State Diagram
238
Chapter 7 State Diagram
20. According to above method, follow the table below to create more transitions on the diagram, and adjust
the transitions and transition names to appropriate locations.
From To Name
Repairing Available repaired
Available Rented rental issued
Rented Available returned
Available Booked booking issued
Booked Available booking cancelled
Booked Rented booking change to
rental
Table 7-2 Transitions table
239
Chapter 7 State Diagram
Exercise
Draw the below diagram according to the guidelines given in this chapter.
240
Chapter 8 Class Diagram
241
Chapter 8 Class Diagram
2. Click on Create Class Diagram on the pop-up menu. A blank new class diagram appears.
242
Chapter 8 Class Diagram
Method 3 – Creating a blank new class diagram using the Project Explorer
1. Right click on the Class Diagram directory in the Project Explorer. A pop-up menu appears.
2. Click on Create Class Diagram on the pop-up menu. A blank new class diagram appears.
243
Chapter 8 Class Diagram
244
Chapter 8 Class Diagram
245
Chapter 8 Class Diagram
246
Chapter 8 Class Diagram
Creating a Class
Method 1 – Creating a class using the Class Diagram Palette
1.Click on the Class button on the Class Diagram Palette. Click on the desired location on the
diagram. A new class appears.
2. Rename the newly created class. Press Ctrl + Enter to finish the operation.
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
247
Chapter 8 Class Diagram
2. Press one of the resource icons with Class ( , , , ...). A new class appears.
3. Drag the new class to the desired location. Release the mouse button.
4. Rename the newly created class. Press Ctrl + Enter to finish the operation.
Adding an Attribute
Method 1 – Adding an attribute to a class using the pop-up menu
248
Chapter 8 Class Diagram
2. Click on New attribute on the pop-up menu. A new attribute is added to the class.
249
Chapter 8 Class Diagram
250
Chapter 8 Class Diagram
2. Click on Open specification on the pop-up menu. The class specification dialog box appears.
3. Click on the Attributes tab in the specification dialog box. The attribute table appears.
251
Chapter 8 Class Diagram
5.Click on Add… on the pop-up menu. The Attribute Specification dialog appears. In the General tab, edit
attribute properties – Name, Initial Value, Multiplicity, Visibility, Type, Scope, Documentation and
Visible.
252
Chapter 8 Class Diagram
6.Click on the Java Attribute Code Detail in the dialog. Set the final, transient, and volatile properties for
the attribute.
253
Chapter 8 Class Diagram
7.Click on OK button to close the Attribute Specification dialog box. The attribute is added to the class.
Click on OK button to close the Class Specification.
Adding an Operation
Method 1 – Adding an operation to a class using the pop-up menu
254
Chapter 8 Class Diagram
3. Rename the operation name. Press Ctrl + Enter to finish the operation.
255
Chapter 8 Class Diagram
256
Chapter 8 Class Diagram
2. Click on Open Specification in the pop-up menu. The class specification dialog box appears.
257
Chapter 8 Class Diagram
5.Click on Add... button on the popup menu. The Operation Specification dialog appears. In the General
tab, edit the properties – Name, Stereotype, Return Type, Visibility, Scope, Documentation, Abstract,
Query and Visible.
258
Chapter 8 Class Diagram
259
Chapter 8 Class Diagram
7.To add parameter to the operation, click the Add… button in the dialog. The Parameter Specification
dialog appears. Edit the parameter properties – Name, Stereotype, Type, Direction, Default Value and
Documentation.
8.Click the Java Parameter Code Detail tab in the Parameter Specification dialog. Edit the final
properties for the parameter.
260
Chapter 8 Class Diagram
9. Click on OK to close the Parameter Specification dialog. The new parameter is added to the operation.
261
Chapter 8 Class Diagram
10. Click the Java Operation Code Detail in the Operation Speciation dialog. Edit the properties - final,
native and synchronized for the operation.
262
Chapter 8 Class Diagram
11. Click OK button to close the Operation Specification dialog. The new operation is added to the class.
263
Chapter 8 Class Diagram
264
Chapter 8 Class Diagram
3. Click on Attribute Sort Type in the popup menu. A cascading menu appears.
4. Choose one of the sorting types in the cascading menu. The attributes of the class will be sorted.
265
Chapter 8 Class Diagram
266
Chapter 8 Class Diagram
7. Click on Operation Sort Type in the popup menu. A cascading menu appears.
8. Choose one of the sorting types in the cascading menu. The operations of the class will be sorted.
Visibility Setting
By default, the visibility style is set to icon style. The visibility style for a class can be changed.
267
Chapter 8 Class Diagram
268
Chapter 8 Class Diagram
3.Click on Visibility Style on the pop-up menu. A cascading menu appears. Check the UML Style
option.
269
Chapter 8 Class Diagram
5. To disable the visibility, check the Off checkbox. The visibility is disabled.
270
Chapter 8 Class Diagram
2. Check the Abstract Class option on the pop-up menu. The class is set to abstract class.
2. Check on the Action checkbox on the pop-up menu. The class is set to active.
271
Chapter 8 Class Diagram
272
Chapter 8 Class Diagram
2. Click on Open Specification on the pop-up menu. The specification dialog box appears.
3.Click on the General tab. Click on the Stereotype pull-down box and select one of the stereotypes
(Interface, Entity, Control, Boundary, or define a new stereotype by typing the stereotype name in the
pull-down box).
273
Chapter 8 Class Diagram
4. Click on OK to close the specification dialog box. The shape of the class will be changed.
Interface
Entity
Control
Boundary
User define
274
Chapter 8 Class Diagram
Creating a Package
Method 1 – Creating a package using the Class Diagram Palette
1.Click on the Package button on the Class Diagram Palette. Click on the desired location on the
diagram. A new package appears.
2. Rename the newly created package. Press Ctrl + Enter to finish the operation.
3. Create a class in the package. Then the package contains the class.
4. The project tree in the Project Explorer will show the hierarchy of the packages.
275
Chapter 8 Class Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press one of the resource icons with Class ( , , ...). A new class appears.
276
Chapter 8 Class Diagram
3. Drag the new package to the desired location. Release the mouse button.
4. Rename the newly created package. Press Ctrl + Enter to finish the operation.
Creating a Collaboration
Method 1 – Creating a collaboration using the Class Diagram Palette
1.Click on the Collaboration button on the Class Diagram Palette. Click on the desired location
on the diagram. A new collaboration appears.
2. Rename the newly created collaboration. Press Ctrl + Enter to finish the operation.
277
Chapter 8 Class Diagram
1. Click on a collaboration listed above on the diagram. Resource icons appear around the collaboration.
2. Press one of the resource icons with collaboration. A new collaboration appears.
3. Drag the new collaboration to the desired location. Release the mouse button.
4. Rename the newly created collaboration. Press Ctrl + Enter to finish the operation.
278
Chapter 8 Class Diagram
Defining a Constraint
1.Click on the Constraint button on the Class Diagram Palette. Drag from the source diagram
element to the target diagram element.
2. Rename the newly created constraint. Press Ctrl + Enter to finish the operation.
279
Chapter 8 Class Diagram
1.Click on the Association button on the Class Diagram Palette. Drag from the source diagram element
to the target diagram element.
2. Release the mouse button. A new association is created between the diagram elements.
280
Chapter 8 Class Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
3. Drag the new class to the target diagram element. The target diagram element is selected.
4. Release the mouse button. The association link is created between the diagram elements.
281
Chapter 8 Class Diagram
1.Click on the Aggregation button on the Class Diagram Palette. Drag from a class to the other
class.
2. Release the mouse button. A new aggregation relationship link is created between the classes.
282
Chapter 8 Class Diagram
2. Press on the Aggregation -> class resource icon. A new class appears.
3. Drag the new class to the target class. The new class disappears. The target class is selected.
4. Release the mouse button. The aggregation relationship link is created between the classes.
Method 3 – Creating an aggregation relationship link using an existing association relationship link
You can change an existing association relationship link to an aggregation relationship link.
283
Chapter 8 Class Diagram
3. Click Aggregation Kind on the cascading menu. A list of aggregation kinds appears.
4.Click on Aggregation on the pop-up menu. The association relationship is changed to an aggregation
relationship link.
284
Chapter 8 Class Diagram
1.Click on the Composition button on the Class Diagram Palette. Drag from a class to the other
class.
2. Release the mouse button. A new composition relationship link is created between the classes.
Method 2 – Creating a composition relationship link using the resource centric interface
1. Click on an existing class in the diagram. Resource icons appear the class.
285
Chapter 8 Class Diagram
3. Drag the new class to the target class. The new class disappears. The target class is selected.
4. Release the mouse button. The composition relationship link is created between the classes.
Method 3 – Creating a composition relationship link using an existing association relationship link
An existing association relationship link can be changed to a composition relationship link.
286
Chapter 8 Class Diagram
3. Click on Aggregation Kind in the cascading menu. A list of aggregation kinds appears.
4.Click on Composition on the pop-up menu. The association relationship link is then changed to a
composition relationship link.
287
Chapter 8 Class Diagram
288
Chapter 8 Class Diagram
3.To edit if the role is navigable or not, click on the Navigable check box. The navigation between the
elements is changed
4.To edit the multiplicity of a role, right click on the association. A popup menu appears. Click on Role A /
Role B on the popup menu. A cascading menu appears.
289
Chapter 8 Class Diagram
7. Use the same way to set the multiplicity of the other role.
8.To edit the visibility of the role, right click on the association. A popup menu appears. Click on Role A /
Role B. A cascading menu appears.
9. Click on Visibility on the cascading menu. A list of visibilities appears. Choose one of the visibilities.
290
Chapter 8 Class Diagram
10. To edit the aggregation kind, right click on the association. A popup menu appears. Click on Role A /
Role B. A cascading menu appears.
11. Click on Aggregation Kind on the cascading menu. A list of aggregation types appears.
12. Choose one of the aggregation kinds. The aggregation type of the role is changed.
291
Chapter 8 Class Diagram
13. To edit a role name, right click on the association. A popup menu appears. Click Role A / Role B on the
popup menu. A cascading menu appears.
14. Click Edit Role A/B Role Name on the cascading menu. An input dialog appears.
292
Chapter 8 Class Diagram
293
Chapter 8 Class Diagram
2. Click Open Specification… on the popup menu. The Association Specification dialog appears.
294
Chapter 8 Class Diagram
3.Edit the Role name, Multiplicity and Navigable properties of the roles. Or click on the button near
the Role text field. The Association End Specification dialog appears. Edit the properties of the role.
295
Chapter 8 Class Diagram
5.Click the Add… button on the Association End Specification dialog. The Attribute Specification dialog
appears. (See Adding an Attribute Section)
6. Click on the OK button on the Attribute Specification dialog. The new attribute is added as a qualifier.
296
Chapter 8 Class Diagram
1.Click on the Generalization button on the Class Diagram Palette. Drag from the source diagram
element to the target diagram element.
2.Release the mouse button. A new generalization relationship link is created between the diagram elements.
Method 2 – Creating a generalization relationship link using the resource centric interface
Diagram elements that a generalization relationship link can be created from, using the resource centric
interface:
z A class , and
z A package .
297
Chapter 8 Class Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the Generalization -> class button resource icon. A new diagram element appears.
3.Drag the new diagram element to the target diagram element. The new diagram element disappears. The
target diagram element is selected.
4. Release the mouse button. The generalization relationship link is created between the diagram elements.
298
Chapter 8 Class Diagram
1.Click on the Realization button on the Class Diagram Palette. Drag from a class to the other
class.
2. Release the mouse button. A new realization relationship link is created between the classes.
Method 2 – Creating a realization relationship link using the resource centric interface
299
Chapter 8 Class Diagram
1. Click on a class on the diagram. Resource icons appear around the class.
2. Press on the Realization -> class resource icon . A new class appears.
3. Drag the new class to the target class. The new class disappears. The target class is selected.
4. Release the mouse button. The realization relationship link is created between the classes.
300
Chapter 8 Class Diagram
1.Click on the Dependency button on the Class Diagram Palette. Drag from the source diagram
element to the target diagram element.
2. Release the mouse button. A new dependency relationship link is created between the diagram elements.
Method 2 – Creating a dependency relationship link using the resource centric interface
Diagram elements that a dependency relationship link can be created from, using the resource centric
interface are:
z A class , and
z A package.
301
Chapter 8 Class Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
2. Press on the resource icon with dependency ( , ,…). A new diagram element appears.
3.Drag the new diagram element to the target diagram element. The new diagram element disappears. The
target diagram element is selected.
4. Release the mouse button. The dependency relationship link is created between the diagram elements.
302
Chapter 8 Class Diagram
2. Release the mouse button. The target class becomes an association class.
1. Click on an existing association relationship link. Resource icons appear the association relationship link.
3. Drag the class to the desired location. Release the mouse button.
4. Rename the newly created association class. Press Ctrl + Enter to finish the operation.
303
Chapter 8 Class Diagram
1.Click on the n-ary button on the Class Diagram Palette. Click on the desired location on the
diagram. A new n-ary association element is created.
2.Click on the newly created n-ary association element. Resource icons appear around the n-ary association
element.
304
Chapter 8 Class Diagram
4.Release the mouse button. A new association link is created between the class and the n-ary association
element. Repeat the steps above to make the n-ary association element to link to more classes.
2.Click on the newly created n-ary association element. Resource icons appear around the n-ary association
element.
4.Drag the new class to the desired location. Release the mouse button. The association is created between
the new class and the n-ary association element.
305
Chapter 8 Class Diagram
5. Repeat the steps above to make the n-ary association element to link to more classes.
1.Click on the Containment button on the Class Diagram Palette. Drag from the source diagram
element to the target diagram element.
2. Release the mouse button. A new containment relationship is created between the diagram elements.
306
Chapter 8 Class Diagram
1.Click on an existing diagram element listed above on the diagram. Resource icons appear around the
diagram element.
307
Chapter 8 Class Diagram
3. Drag the new class to the target diagram element. The target diagram element is selected.
4. Release the mouse button. The containment relationship is created between the diagram elements.
Method 1 – Creating a blank new class diagram using with real time code generation the main menu
308
Chapter 8 Class Diagram
Method 2 – Creating a blank new class diagram with real time code generation using the toolbar
2.Click on Create Class Diagram with Real Time Code Generation on the pop-up menu. A blank new
class diagram appears.
309
Chapter 8 Class Diagram
Method 3 – Creating a blank new class diagram using the Project Explorer
1.Right click on the Class Diagram directory in the Project Explorer. A pop-up menu appears.
2.Click on Create Class Diagram with Real Time Code Generation on the pop-up menu. A blank new
class diagram appears.
310
Chapter 8 Class Diagram
1. Right click on a blank place on an existing class diagram. A popup menu appears.
311
Chapter 8 Class Diagram
312
Chapter 8 Class Diagram
313
Chapter 8 Class Diagram
6. Click on any existing class in the class diagram. The code will be generated in the Code Pane.
1. Create a new class on the class diagram. The generated code for the class is shown in the Code Pane.
314
Chapter 8 Class Diagram
315
Chapter 8 Class Diagram
5. Click on Open Specification on the popup menu. The Class Specification dialog appears.
316
Chapter 8 Class Diagram
6.Click on the Java Class Code Detail tab in the Class Specification dialog. The class can be set to final or
interface.
317
Chapter 8 Class Diagram
1. Right click on an existing class on the class dialog. A popup menu appears.
2.Click on New Attribute on the popup menu. A new attribute is added to the class and the code in the Code
Pane is updated at the same time.
318
Chapter 8 Class Diagram
4. Click on Open Specification on the popup menu. The Class Specification dialog appears.
319
Chapter 8 Class Diagram
5. Click on the Attributes tab in the Class Speciation dialog. A list of attributes is shown.
320
Chapter 8 Class Diagram
7. Edit the attribute properties – Name, Initial Value, Visibility and Type.
321
Chapter 8 Class Diagram
8.Click on the Java Attribute Code Detail tab on the Attribute Specification dialog. Check the final check
box.
9.Click on the OK button on the Attribute Specification dialog to close it. The Class Specification dialog is
active again.
322
Chapter 8 Class Diagram
10. Click on the OK button on the Class Specification dialog to close it. The code for the attribute is
updated.
323
Chapter 8 Class Diagram
2.Click on New Operation on the popup menu. A new operation is added to the class and the code generated
for the operation is added to the Code Pane.
324
Chapter 8 Class Diagram
4. Click on Open Specification on the popup menu. The Class Specification dialog appears.
5. Click on the Operations tab in the Class Specification dialog. A list of operations is shown.
325
Chapter 8 Class Diagram
326
Chapter 8 Class Diagram
327
Chapter 8 Class Diagram
8. Click on the Java Operation Code Detail tab in the Operation Specification dialog.
328
Chapter 8 Class Diagram
9. An operation can be set to be final, native or synchronized. Click on the Parameters tab in the dialog
329
Chapter 8 Class Diagram
10. Click on the Add… button to add a parameter. The Parameter Speciation dialog appears.
330
Chapter 8 Class Diagram
12. Click the Java Parameter Code Detail in the Parameter Specification dialog.
331
Chapter 8 Class Diagram
13. A parameter can be set to be final. Click on the OK button in the dialog to close it. The Operation
Specification dialog is active again.
332
Chapter 8 Class Diagram
14. A new parameter is added to the operation. Click the OK button to close the Operation Speciation
dialog. The Class Specification dialog is active again.
15. Click the OK button in the Class Specification dialog. The code generated for the operation is updated.
333
Chapter 8 Class Diagram
2. Place an existing class in the package. The code generated for the class is updated.
334
Chapter 8 Class Diagram
2.Create a dependency relationship between an existing class and the new package. The code generated for
the class is updated.
335
Chapter 8 Class Diagram
2.Create a dependency relationship between a class and the new class. The code generated for the importing
class is updated.
336
Chapter 8 Class Diagram
Example
1.Click on the class button on the Class Diagram Palette. Click on the desired location on the class diagram.
A new class appears. Rename the class as “Vehicle”. Then right click on the class. A pop-up menu appears.
Click on N ew Attribute on the pop-up menu. A new attribute is added to the class. Double click on
the new attribute. A text box appears. Type “-regNo” in the text box. (- for private, + for public, # for
protected). Add more attributes: -modelNo, . Add more operations: +isAvailable():Boolean, .
2.Right click on the Vehicle class. A pop-up menu appears. Click on Visibility Option on the pop-up
menu. A cascading menu appears. Click on UML Style on the cascading menu.
3.Click on the Vehicle class. Resource icons appear around the class. Click on the Association -> Class
resource icon. A new class appears. Drag the new class to the desired location. Rename the new class as
“Branch”. An association relationship is created between the classes.
337
Chapter 8 Class Diagram
4.Right click on the association link. A pop-up menu appears. Click on Role A(Vehicle). A cascading
menu appears. Click on Multiplicity on the cascading menu. A list of multiplicities appears. Click on 0..*.
The multiplicity of Vehicle role is set to 0..*. Right click on the association link again. A pop-up menu
appears. Click on Role B(Branch) in the pop-up menu. A cascading menu appears. Click on
Multiplicity on the cascading menu. A list of multiplicities appears. Click on 1 on the cascading menu. The
multiplicity of the Branch role is set to 1. Right click on the new association link. A pop-up menu appears.
Click on Role B(Branch). A cascading menu appears. Uncheck the Navigable checkbox on the
cascading menu.
5.Create a new class. Rename the class as “Rental”. Then create another new class and rename the class as
“Customer”. Create an association relationship link between the Customer class and Rental class. Set the
multiplicity of Customer role to 1 and the Rental role to 0..*. Right click on the new association link. A
pop-up menu appears. Click on Role B(Rental) on the pop-up menu. A cascading menu appears. Uncheck
the Navigable checkbox on the cascading menu.
338
Chapter 8 Class Diagram
6.Click on the Rental class. Resource icons appear around the class. Click on Composition -> Class
resource icon. A new class appears. Drag the new class to the desired location. Rename the new class as
“RentalLine”. A composition relationship is created between the classes. Set the multiplicity of Rental role
to 1 and RentalLine role to 0..*., and set the Rental role to not navigable.
7.Click on the Branch class. Resource icons appear around the class. Click on Aggregation -> Class
resource icon. A new class appears. Drag the new class to the desired location. Rename the new class as
“Staff”. A composition relationship link is created between the classes. Set the multiplicity of Staff role to 1
and of Branch role to 0..*.
339
Chapter 8 Class Diagram
8.Click on the Staff class. Resource icons appear around the class. Click on Self Association resource
icon. A new self association link is created with the class. Right click on the self association. A pop-up
menu appears. Click on Role A(Staff) in the pop-up menu. A cascading menu appears. Click Edit
Role A Role name on the cascading menu. A text box appears. Type in “Manager” as the role name.
Right click on the self association again. A pop-up menu appears. Click on Role B(Staff) in the pop-up
menu. A cascading menu appears. Click Edit Role B Rolename on the cascading menu. A text box
appears. Type in “Staff” as the role name. Set the Role A multiplicity to 1 and Role B multiplicity to 0..*.
Set the Role A to not navigable.
340
Chapter 8 Class Diagram
341
Chapter 8 Class Diagram
Exercise
Draw the diagram below according to the guidelines given in this chapter.
342
Chapter 9 Component Diagram
343
Chapter 9 Component Diagram
344
Chapter 9 Component Diagram
345
Chapter 9 Component Diagram
Creating a Component
Method 1 – Creating a component using the diagram palette
1. To create a component in your component diagram, click on the Component button on the diagram
palette and click on the desire location. A component appears.
346
Chapter 9 Component Diagram
2. Rename the component name, and then press Ctrl + Enter to set the component name.
1. Click on the component. The resource icons appear around the diagram element.
347
Chapter 9 Component Diagram
2. Press mouse button on the Component resource icon . A new component appears.
1. Rename the newly created Component Instance name, and then press Ctrl + Enter to finish the operation.
348
Chapter 9 Component Diagram
1. Click on an existing component instance. The resource icons appear around the diagram element.
2. Press on the Component Instance resource icon . A new component instance appears.
3.Drag the component instance to the desired location. Release the mouse button. The component instance is
created.
Creating an Interface
Method 1 – Creating an Interface using the diagram palette
1.To create an Interface in your component diagram, click on the Interface icon on the diagram palette
and then click on the desired location on the diagram. A new interface is created.
349
Chapter 9 Component Diagram
2. Rename the newly created interface name. Press Ctrl + Enter to finish the operation.
350
Chapter 9 Component Diagram
2.Drag the interface to the Component or Component Instance that you want the interface to be placed in.
Release the mouse button. The Interface is created.
351
Chapter 10 Deployment Diagram
352
Chapter 10 Deployment Diagram
1.Click on the Create Deployment Diagram icon in the toolbar. A new Deployment Diagram appears.
353
Chapter 10 Deployment Diagram
1. Right click on Deployment Diagram directory in the Project Explorer. A pop-up menu appears.
2. Click on Create Deployment Diagram. A new Deployment Diagram appears.
354
Chapter 10 Deployment Diagram
355
Chapter 10 Deployment Diagram
356
Chapter 10 Deployment Diagram
Create Node
Method 1 – Creating a node using the deployment diagram palette
1.Click on the node button in the deployment diagram palette. Click on the desired location in the
diagram. A new note appears.
357
Chapter 10 Deployment Diagram
2. Rename the newly added note. Press Ctrl + Enter to finish the operation.
1. Click on an existing node in the diagram. Resource icons appear around the node.
358
Chapter 10 Deployment Diagram
2. Press on the resource icon with node ( , …). A new node appears.
3. Drag the node to the desired location. Release the mouse button.
4. Rename the newly added node. Press Ctrl + Enter to finish the operation.
359
Chapter 10 Deployment Diagram
Create Component
Method 1 – Creating a component using the deployment diagram palette
1.Click on the component button in the deployment diagram palette. Click on the desired location in
the diagram. A new component appears.
2. Rename the newly added component. Press Ctrl + Enter to finish the operation.
1.Click on an existing diagram element listed above in the diagram. Resource icons appear around the
diagram element.
360
Chapter 10 Deployment Diagram
2. Press on the resource icon with component ( , …). A new component appears.
3. Drag the component to the desired location. Release the mouse button.
4. Rename the newly added component. Press Ctrl + Enter to finish the operation.
2. Rename the newly added component instance. Press Ctrl + Enter to finish the operation.
361
Chapter 10 Deployment Diagram
1.Click on an existing diagram element listed above in the diagram. Resource icons appear around the
diagram element.
2. Press on a resource icon with component instance ( , …). A new component instance appears.
3. Drag the component instance to the desired location. Release the mouse button.
362
Chapter 10 Deployment Diagram
4. Rename the newly added component instance. Press Ctrl + Enter to finish the operation.
Create Interface
Method 1 – Creating an interface using the deployment diagram palette
1.Click on the interface button in the deployment diagram palette. Click on the desired location in the
diagram. A new interface appears.
2. Rename the newly added interface. Press Ctrl + Enter to finish the operation.
363
Chapter 10 Deployment Diagram
1.Click on an existing diagram element listed above in the diagram. Resource icons appear around the
diagram element.
2. Press on the resource icon with interface ( , …). A new interface appears.
3. Drag the interface to the desired location. Release the mouse button.
4. Rename the newly added interface. Press Ctrl + Enter to finish the operation.
364
Chapter 10 Deployment Diagram
Create Object
1.Click on the object button in the activity diagram palette. Click on the desired location in the diagram.
A new object appears.
2. Rename the newly added object. Press Ctrl + Enter to finish the operation.
1.Click on the association button in the use case diagram palette. Drag from the source actor or the
target node.
365
Chapter 10 Deployment Diagram
2. Release the mouse button. A new association is created between the nodes.
1. Click on an existing node in the diagram. Resource icons appear around the node.
366
Chapter 10 Deployment Diagram
3. Drag the new node to the target node. The target is selected.
4. Release the mouse button. The association is created between the nodes.
367
Chapter 10 Deployment Diagram
1.Click on the dependency button in the class diagram palette. Drag from the source diagram element
to the target diagram element.
2. Release the mouse button. A new dependency relationship is created between the diagram elements.
1.Click on an existing diagram element listed above in the diagram. Resource icons appear around the
diagram element.
2.Press on a resource icon with dependency ( , , …). A new diagram element appears. (Note: the
resource icon must be correspondent to the target diagram element)
368
Chapter 10 Deployment Diagram
3. Drag the new diagram element to the target diagram element. The target diagram element is selected.
Release the mouse button. The dependency relationship is created between the diagram elements.
369
Chapter 11 Report Generator
HTML Report
Generating HTML Report
370
Chapter 11 Report Generator
3. Click on HTML… on the cascading menu. The Generate HTML dialog appears.
371
Chapter 11 Report Generator
4.Input the directory for generating the report in the File location text field. Or click on the button near
beside the File location text field. The Open dialog appears.
5. Select the directory for generating report. Click on the OK button in the Open dialog.
372
Chapter 11 Report Generator
6. Check the Launch viewer check box to view the report after generation.
7.Check the check boxes in the tree of the Print Diagram frame to specific which diagrams will be used to
generate the report.
373
Chapter 11 Report Generator
8.Check the Generate diagrams check box to generate the diagrams to images and add to the report. Click
the Template combo box to select a template for the report. For example, select Use Case Diagram
Report to generate a report with use case diagrams only.
9.Check the Graphics antialiasing check box and the Text antialiasing check box.
374
Chapter 11 Report Generator
10. Click on the Header/Footer tab to edit the header and footer of the report.
11. Check the Use header check box and Use footer check box.
375
Chapter 11 Report Generator
12. Click on the Alignment combo box to select the header alignment. The Preview frame will be update to
show the format of the header and the footer.
13. Click on the Font name combo box to select the font of the header or footer.
376
Chapter 11 Report Generator
14. Click on the Font style combo box to select the style and click on the Font size combo box to select the
size of the font.
377
Chapter 11 Report Generator
15. Click on the button beside the Font color label. The Font Color dialog appears. Select a color
and click on the OK button in the dialog.
16. Click on the Document Info tab in the dialog. Input the title, author and keywords for the report.
378
Chapter 11 Report Generator
17. Click on the OK button in the dialog. The dialog will be close. The Generating HTML Document
dialog appears to show the progress.
18. When the progress reaches to 100%, click on the Close button in the dialog. The dialog will be closed.
379
Chapter 11 Report Generator
19. The browser will be opened automatically with the report generated.
1.After the report is generated, open the report. The frame on the left hand side is a tree for browsing the
diagram and the diagram details.
380
Chapter 11 Report Generator
2. Click on the tree to select a diagram. The frame on the right hand side will show the diagram.
3. Click on the view detail link to see the details of the diagram.
381
Chapter 11 Report Generator
4. The frame on the right hand side will show the diagram details.
382
Chapter 11 Report Generator
6. Click on the link under the diagram to see a diagram element details.
383
Chapter 11 Report Generator
384
Chapter 11 Report Generator
385
Chapter 11 Report Generator
386
Chapter 11 Report Generator
387
Chapter 11 Report Generator
14. The following is the report for the problem statement having textual analysis performed.
388
Chapter 11 Report Generator
389
Chapter 11 Report Generator
PDF Report
1. To generate a PDF report, click on Tools on the menu bar. The Tools menu appears.
390
Chapter 11 Report Generator
3. Click on PDF on the cascading menu. The Generate PDF dialog appears.
4.Input the file name for generating the report in the File location text field. Or click on the button
near beside the File location text field. The Open dialog appears.
391
Chapter 11 Report Generator
5. Select the directory and the file name for generating report. Click on the OK button in the Open dialog.
6. Check the Launch viewer check box to view the report after generation.
392
Chapter 11 Report Generator
7.Check the check boxes in the tree of the Print Diagram frame to specific which diagrams will be used to
generate the report.
8.Check the Generate diagrams check box to generate the diagrams to images and add to the report. Click
the Template combo box to select a template for the report. For example, select Use Case Diagram
Report to generate a report with use case diagrams only.
393
Chapter 11 Report Generator
9. Click on the Diagram quality combo box to select the quality of the diagrams in the report.
10. Check the Graphics antialiasing check box and the Text antialiasing check box.
394
Chapter 11 Report Generator
11. Click on the Page tab in the dialog to edit the page layout of report.
395
Chapter 11 Report Generator
13. Click on the Page size combo box to select the page size.
396
Chapter 11 Report Generator
15. Click on the Header/Footer tab to edit the header and footer of the report.
16. Check the Use header check box and Use footer check box.
397
Chapter 11 Report Generator
17. Click on the Header style combo box to select one of the styles.
18. Click on the Alignment combo box to select the header alignment. The Preview frame will be update to
show the format of the header and the footer.
398
Chapter 11 Report Generator
19. Click on the Footer style combo box to select one of the styles.
20. Input the footer text in the Footer Text text field.
399
Chapter 11 Report Generator
21. Click on the Document Info tab in the dialog. Input the title, subject, author, keywords, info header and
info header content for the report. Check the Allow modify check box to allow the PDF report to be
modified.
22. Click on the Generate button in the dialog to generate the report.
400
Chapter 11 Report Generator
23. The Generating PDF Document dialog appears to show the progress.
24. When the progress reaches 100%, click on the Close button in the dialog. The dialog will be close.
401
Chapter 11 Report Generator
1.After the report is generated, open the report. The frame on the left hand side is a list for browsing the
diagram and the diagram details.
402
Chapter 11 Report Generator
2.Click on the list to select a diagram. The frame on the right hand side will show the diagram and the
diagram details. The following is the report for a use case diagram.
403
Chapter 11 Report Generator
404
Chapter 11 Report Generator
405
Chapter 11 Report Generator
406
Chapter 11 Report Generator
8. The following is the report for the problem statement having textual analysis performed.
407
Chapter 12 Code Generation
The followings are situations that the Log Pane will display warning messages or error messages:
z A class inherits from multiple classes.
z A class is set to be final and interface at the same time.
z A class realizes another class or another interface.
z An interface extends a class.
1.To perform syntax checking for the current project, click on Code on the menu bar. The Code menu
appears.
408
Chapter 12 Code Generation
3.Click Syntax Check in the cascading menu. The Check model with Java syntax dialog appears to show
the progress. (If the Code Engine Set Configuration dialog appears, click on the Code Generation tab
and input the working directory in the Working Directory text field.)
409
Chapter 12 Code Generation
4.When the progress reaches to 100%, click on the Close button in the dialog. The warning messages and
error message is shown in the Log Pane.
410
Chapter 12 Code Generation
2.Click on the Code generation syntax check button on the menu. The Check model with Java syntax
dialog appears to show the progress.
3. When the progress reaches to 100%, click on the Close button in the dialog.
411
Chapter 12 Code Generation
4. Adjust the height of the Log Pane (if needed) to see the warning messages and error messages.
412
Chapter 12 Code Generation
413
Chapter 12 Code Generation
3. Click on Generate on the cascading menu. The Java Code Generate Options dialog appears.
4. Click on the Default attribute type combo box. A list of attribute type appears.
414
Chapter 12 Code Generation
6.To add Java documentation to the header in class files, input the documentation in the Header description
text pane.
415
Chapter 12 Code Generation
7.Check the Generate JavaDoc check box. The Preview text pane is updated. The JavaDoc is added to the
sample source.
8.To generate import statement in the source, check the Automatic import statement generation checkbox.
The Preview text pane is updated. The import statements are added to the sample source.
416
Chapter 12 Code Generation
9.To set the brace style of the source code, click on the combo boxes in the Braces frame. A list of style
appears.
10. Select one of the brace style. The source code in the Preview text pane is updated.
417
Chapter 12 Code Generation
12. Input the working directory in the Working directory text field for code generation.
418
Chapter 12 Code Generation
14. Check the check box of the project in the Available Classes for Code Engineering frame. All the check
boxes of the class models are checked.
419
Chapter 12 Code Generation
15. Click on the button to add the class models in the Selected Classes for Code Engineering frame
for code generation.
16. Click on the OK button in the dialog to close it. The Code generation dialog appears to show the
progress.
420
Chapter 12 Code Generation
17. When the progress reaches 100%, click on the Close button in the dialog to close it. The Code Preview
dialog appears.
18. A list of classes is shown in the Generated Classes tree. Click on one of the class in the tree. The Java
source generated is shown.
421
Chapter 12 Code Generation
19. Click on the Close button in the Code Preview dialog to close it.
422
Chapter 12 Code Generation
1.To generate Java code for an existing class in the class diagram, right click on the class. A popup menu
appears.
2. Click on Generate code on the popup menu. The Code Generation Options dialog appears.
423
Chapter 12 Code Generation
3. Set the preferences for code generation. Click on the OK button in the dialog to close it.
424
Chapter 12 Code Generation
5.When the progress reaches to 100%, the source code is generated for the class. Click on the Close button in
the dialog to close it.
425
Chapter 12 Code Generation
426
Chapter 12 Code Generation
3. Check the Show Code Pane check box in the popup menu.
427
Chapter 12 Code Generation
428
Chapter 12 Code Generation
7.Click an existing class in the class diagram. The code is generated for the class and shown in the Code
Pane.
429
Chapter 12 Code Generation
8. Adjust the Code Pane (if needed) to see the generated source code.
430
Chapter 13 Code Reverse Engineering
1. Open a class diagram in the Project Explorer. The class diagram is shown.
431
Chapter 13 Code Reverse Engineering
432
Chapter 13 Code Reverse Engineering
4. The Code Pane is shown. Click on the class diagram again. A popup menu appears.
433
Chapter 13 Code Reverse Engineering
6. Click on a class in the class diagram. The code for the class is generated.
7. Add an attribute in the Code Pane. The class in the class diagram will be updated with the attribute added.
434
Chapter 13 Code Reverse Engineering
8.Add an operation in the Code Pane. The class in the class diagram will be updated with the operation
added.
435
Chapter 13 Code Reverse Engineering
436
Chapter 13 Code Reverse Engineering
3.Click Option in the cascading menu. The Code Engine Set Configuration dialog appears. Click on the
Code Generation tab in the dialog.
437
Chapter 13 Code Reverse Engineering
438
Chapter 13 Code Reverse Engineering
7.Click on the Code Reverse Engineering tab in the dialog. The Source Paths and Classpaths are updated.
(The source paths are the path containing the Java files to be reserved. The class paths are the path
containing the class files to be referenced. To add more source path and class path, click on the Add…
button.)
439
Chapter 13 Code Reverse Engineering
8.Check the Lock for classes in classpath for reserving the class name fully qualified. (e.g. String =>
java.lang.String). Check the Merge mode and code for updating the already existing class in class
diagram from code.
440
Chapter 13 Code Reverse Engineering
10. Click Code in the menu bar. The Code menu appears.
441
Chapter 13 Code Reverse Engineering
12. Click on Reverse on the cascading menu. The Code reserve engineering dialog appears to show the
progress. The Java files in the source path will be reserved to class models.
13. When the progress reaches 100%, click on Close in the dialog. The class models are added in the Model
Tree.
442
Chapter 13 Code Reverse Engineering
15. Right click on the root directory in the Tree Model. A popup menu appears.
443
Chapter 13 Code Reverse Engineering
16. Click on Collapse All to collapse the tree to see all the class models generated.
444
Chapter 13 Code Reverse Engineering
3.Click on New Class Diagram / New Class Diagram with Real Time Code Generation in the cascading
menu.
445
Chapter 13 Code Reverse Engineering
4.Drag the class models from the Model Tree to the new class diagram. The class models reserved from the
Java files will be added to the class diagram.
446
Chapter 13 Code Reverse Engineering
1.To update a class model from the Java file, right click on the class. A popup menu appears.
447
Chapter 13 Code Reverse Engineering
2.Click on Reverse code on the popup menu. The Code Reserve Engineering Options dialog appears.
3.Click on the OK button in the dialog. The Code reverse engineering dialog appears to show the progress.
448
Chapter 13 Code Reverse Engineering
4.When the progress reaches 100%, click on Close in the dialog. The class model and the class in the class
diagram will be updated.
449
Chapter 14 Print Preview Window
450
Chapter 14 Print Preview Window
1. Click on File on the main menu. Click on Print... under the file menu. Alternatively, click on the
Print icon on the toolbar. The Print Preview Window appears.
451
Chapter 14 Print Preview Window
Fit to Ratio Set the diagram size to fit into specified ratio.
Set the diagram size to fix into page(s).
Fit to Pages
- Set Front
- Insert Date
- Insert Time
452
Chapter 14 Print Preview Window
Printing
Printing Diagrams
1.To print diagrams, check the check boxes of the desired diagrams in the Project Explorer. The print preview
area will show the selected diagram.
453
Chapter 14 Print Preview Window
2. Click on the Print button on the toolbar. The Print dialog box appears.
Print Settings
1. Click on the Print button on the toolbar. The Print dialog box appears.
2. Set the pages and the number of copies to be printed. Click OK to print the diagrams.
454
Chapter 14 Print Preview Window
Page Settings
1. Click on the Setup Page button on the toolbar. The Page Setup dialog box appears.
2. Click on the Size pull-down box to select the paper type. The page view will be updated.
455
Chapter 14 Print Preview Window
4. Click on either the Portrait/Landscape Orientation. The page view will be updated.
456
Chapter 14 Print Preview Window
5.To set the Margins of the paper, click on the Left, Right, Top or Button text box and input the
corresponding margin sizes. The page view will be updated.
457
Chapter 14 Print Preview Window
1.Click on the Adjust Margin button on the toolbar. The preview area shows a blank paper and the
2.Edit the margins with the text boxes – Header, Footer, Top, Bottom, Left and Right. Alternatively, you
can drag the margin lines on the paper to adjust the margins.
458
Chapter 14 Print Preview Window
3.Click on the Adjust Margin button on the toolbar again to preview the diagram. The margins will
be updated.
Zooming
459
Chapter 14 Print Preview Window
1.Click on the Zoom Pages pull-down box to select the zoom percentage. The preview area will be updated.
460
Chapter 14 Print Preview Window
1.To set the diagram base layout in the preview area, Click on the Diagram Base Layout button on
461
Chapter 14 Print Preview Window
1.Click on the Paper Place Style button on the toolbar to set the place style. The style is now set to
462
Chapter 14 Print Preview Window
Fit to Ratio
1. Click on the Fit to pull-down box to select the Ratio for fitting the diagram with ratio.
463
Chapter 14 Print Preview Window
2. Input the ratio, for example 50%, in the Ratio text box. The diagrams in the preview area will be updated.
Fit to Pages
464
Chapter 14 Print Preview Window
1. Click on the Fit to pull-down box to select Pages for fitting the diagram with pages.
2. Click on the Fit to Column and Row button on the toolbar. The page layout selector appears.
465
Chapter 14 Print Preview Window
3.Move the mouse cursor to select rows and columns. Then click on the selected cell. The diagram will be cut
into (row x column) pages.
466
Chapter 14 Print Preview Window
1.Click on the Overlapping text box to input the over lapping percentage, 20%. Then press Enter. The
pages will be updated in the preview area. The diagram image near the margin will be duplicated.
467
Chapter 14 Print Preview Window
1.Click on the Show Image Clip Mark button on the toolbar. The diagrams will be surrounded by the
468
Chapter 14 Print Preview Window
1. Click on the Edit Header/Footer button on the toolbar. The Header/Footer editor appears.
469
Chapter 14 Print Preview Window
3.Click on the Edit Header/Footer button again. The Header/Footer editor is closed. The header and
470
Chapter 14 Print Preview Window
2. Click on the Multi Page Mode button on the toolbar. The preview area with Multi Page Options
appears.
471
Chapter 14 Print Preview Window
2. Click on the page layout selector on the toolbar. Select the rows and columns.
3.Then click on the selected cell. The preview area will be updated. A sheet now contains (rows x columns)
pages.
472
Chapter 14 Print Preview Window
4. Click on the Page Style button to change the page style. The print preview area will be updated.
5. Click on the Multi Page Mode button again to exit the multi page mode.
473
Chapter 14 Print Preview Window
1. Click on the Close button to close the Print Preview Window and switch back to the VPUML.
474