Uml - Rational Rose Manual - 2000

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 356

Rational Rose 2000

Using Rose
Copyright © 1993-1999 Rational Software Corporation.
All rights reserved.

Part Number: 800-012795-000


Revision 6.5, September 1999, (Software Release 2000)
This document is subject to change without notice.
GOVERNMENT RIGHTS LEGEND: Use, duplication, or disclosure by the U.S.
Government is subject to restrictions set forth in the applicable Rational
Software Corporation license agreement and as provided in DFARS 227.7202-
1(a) and 227.7202-3(a) (1995), DFARS 252.227-7013(c)(1)(ii) (Oct 1988), FAR
12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14, as applicable.
Rational, the Rational logo, Rational Rose, ClearCase, and Rational Unified
Process are trademarks or registered trademarks of Rational Software
Corporation in the United States and in other countries. All other names are
used for identification purposes only and are trademarks or registered
trademarks of their respective companies.
CorelDraw is a trademark or registered trademark of Corel Corporation.
Visual SourceSafe is a trademark or registered trademark of Microsoft
Corporation.
T Quatrani VISUAL MODELING WITH RATIONAL ROSE AND UML, (pages 3, 4,
29, 39, 73, 142, 153). © 1998 Addison Wesley Longman Inc., -Reprinted by
permission of Addison Wesley Longman. All rights reserved.

ii Rational Rose 2000, Using Rose


Contents

List of Figures xxi

List of Tables xxv

Preface xxvii
How this Manual is Organized xxvii

Online Help xxx

Online Manual xxx

Related Documentation xxx

File Names xxxi

Starting Rational Rose xxxi

Registration xxxi

Chapter 1 Introduction to Visual Modeling Using Rational Rose 1


Visual Modeling 1
Modeling with Rational Rose 3
Notations 4
Features 4
Extending Rational Rose 5

Rational Rose 2000, Using Rose iii


Chapter 2 Getting Started with Rational Rose 7
The Application Window 8
Control-Menu Box 8
Title Bar 9
Minimize and Maximize Button 9
Menu Bar 9
Toolbar 9
Toolbox 12
Customizing the Toolbox 14
Browser 14

Documentation Window 14

Diagram Window 15

Overview Window 16

Specification Window 17

Printing Diagrams and Specifications 17


Print Preview 18
Zoom In and Zoom Out 18
Print 18
One Page and Two Page 18
Close 18
Apply Filter Dialog Box 18

Chapter 3 The Browser 21


Overview 21

Viewing the Browser 22


Hiding and Displaying the Browser 22
Positioning the Browser 22
Docking and Undocking the Browser 23
Expanding and Collapsing the Browser Tree 23
Selecting Multiple Elements in the Browser 24
Navigating a Model 24
Creating and Editing Model Elements 25
Naming an Element in the Browser 26

iv Rational Rose 2000, Using Rose


Using Drag-and-Drop in the Browser 26
Browser to Browser Capabilities 27
Browser to Diagram Capabilities 28
Browser to Specification Capabilities 29

Chapter 4 Introduction to Diagrams 31


Overview 31

Diagram Windows 31
Viewing Diagrams 32
Displaying Multiple Diagrams 33

Creating, Linking, Displaying, Renaming, and Deleting Diagrams 34


Create a New Diagram 34
Link a Diagram 35
Display a Diagram 35
Rename a Diagram 36
Delete a Diagram 36

Selecting Multiple Elements in the Diagram 36

Creating and Naming Model Elements 37


Create an Element on the Diagram 37
Create an Element in the Browser 37
Naming Model Elements 37
Naming an Element on the Diagram 38
Creating/Naming an Overloaded Element on the Diagram 39
Placing an Overloaded Element on the Diagram from the
Browser 39
Fully Qualified Names 40
Renaming Model Elements 40
Reassigning Model Elements 40

Manipulating Icons 41
Deleting, Cutting, Copying, and Pasting Icons 42

Correlations 43
Creating Correlations Between Elements 43

Adorning the Diagrams 45


Manipulating Text 45

Rational Rose 2000, Using Rose v


Chapter 5 Introduction to Specifications 47
Displaying Specifications 47
Custom Specifications 48

Editing Specifications 48

Common Specification Elements 49


Dialog Boxes 49
General Tab 49
Detail Tab 51
Files Tab 51
Tab Buttons 53

Navigating the Tabs 54


Adding and Deleting Entries 54
Editing Entries 54

Chapter 6 Class Diagrams and Specifications 57


Class Diagram Overview 57
Creating and Displaying a Class Diagram 59
Class Diagram Toolbox 59
Assigning a Class to Another Logical Package 60
Adding and Hiding Classes, and Filtering Class Relationships 60

Class Specification 61
Class Specification—General Tab 62
Type 62
Parent 62
Stereotype 63
Export Control 63
Class Specification—Detail Tab 64
Cardinality 65
Space 65
Persistence 66
Concurrency 67
Abstract 67
Formal Arguments 68
Class Specification—Operations Tab 68
Show Inherited 70

vi Rational Rose 2000, Using Rose


Class Specification—Attributes Tab 71
Class Specification—Relations Tab 73
Class Specification—Component Tab 74
Class Specification—Nested Tab 75
Class Specification—Files Tab 77

Class Attribute Specification 78


Class Attribute—General Tab 78
Class 79
Show Classes 79
Type 79
Initial Value 79
Class Attribute—Detail Tab 80
Containment 80
Static 81
Derived 81

Operation Specification 82
Operation Specification—General Tab 83
Return Class 83
Operation Specification—Detail Tab 84
Arguments 84
Protocol 85
Qualifications 85
Exceptions 85
Size 85
Time 85
Concurrency 86
Operation Specification—Preconditions Tab 87
Preconditions 87
Interaction Diagram 87
Operation Specification—Semantics Tab 88
Semantics 88
Interaction Diagram 88
Operation Specification—Postconditions Tab 89
Postcondition 89
Interaction Diagram 89
Operation Specification—Files Tab 90

Parameter Specification 90
Defining a New Parameter 90

Rational Rose 2000, Using Rose vii


Parameter Specification—General Tab 91
Default 91
Owner 91
Type 92

Association Specification 92
Association Specification—General Tab 93
Parent 93
Stereotype 93
Role 94
Element 94
Association Specification—Detail Tab 94
Derived 95
Link Element 95
Name Direction 95
Constraints 95
Association Specification—Role A and B General Tab 96
Association Specification—Role A and B Detail Tab 97
Navigable 97
Aggregate 98
Static 98
Friend 98
Containment of 98
Keys/Qualifiers 99

Generalize Specification 99
Generalize Specification—General Tab 100
Friendship Required 100
Virtual Inheritance 100

Dependency Specification 101


Dependency Specification—General Tab 101

Logical Package Specification 102


Package Specification—General Tab 103
Package Specification—Detail Tab 104
Global 104
Diagrams 105

Has Relationship (Booch Only) 105


Has Specification—General Tab 106
Has Specification—Detail Tab 107

viii Rational Rose 2000, Using Rose


Key/Qualifier Specification 108
Defining a New Key/Qualifier 108
Key/Qualifier Specification—General Tab 109
Owner 109

Chapter 7 Use-Case Diagrams and Specifications 111


Use-Case Diagram Overview 111
Actors 112
Use Case 112
Flow of Events 113
Relationships 113
Association 114
Use-Case Diagram Toolbox 115

Use-Case Specification 115


Use-Case Specification—General Tab 116
Name 116
Package 117
Rank 117
Abstract 117
Use-Case Specification—Diagram Tab 117
Diagrams 118
Use-Case Specification—Relations Tab 118
Relations 119
Generalize Specification—General Tab 119
Stereotype 119
Friendship Required 120
Virtual Inheritance 120

Actor Specification 120

Chapter 8 State Machine Diagrams and Specifications 121


Creating and Displaying a State Machine Diagram 121

State Machine Specification 122


State Machine Specification General Tab 122

Statechart Diagram Overview 123


Creating a Statechart Diagram 123

Rational Rose 2000, Using Rose ix


Automatic Transmission Example 124

Activity Diagram Overview 125


Workflows 125

Creating an Activity Diagram 126

Workflow Modeling 126

Modeling a Workflow with an Activity Diagram 127


Swimlanes 128
Common Statechart and Activity Diagram Model Elements 128
States 128
Activities 129
Start and End States 129
Transitions 129
Transition to Self 130
Decisions 130
Synchronizations 130

Swimlane Specification 130


Swimlane Specification General Tab 131

State and Activity Specifications 131


State and Activity Specification General Tab 132
State and Activity Specification Actions Tab 133
Type 133
Action Expression 133
State and Activity Specification Transitions Tab 134
State and Activity Specification Swimlanes Tab 135

Action Specification 135

Transition Specification 137


State Transition Specification – General Tab 137
State Transition Specification Detail Tab 138
Guard Condition 138
Transition Between Substates 139

x Rational Rose 2000, Using Rose


Decision Specification 139
Decision Specification General Tab 140
Decision Specification Transitions Tab 141
Decision Specification Swimlanes Tab 142

Synchronization Specification 142


Synchronization Specification General Tab 143
Synchronization Specification Transitions Tab 144

Chapter 9 Interaction Diagrams and Specifications 145


Interaction Diagram Overview 145
Creating and Displaying an Interaction Diagram 145

Collaboration Diagrams 146

Sequence Diagrams 147

Toolboxes 149
Collaboration Diagram Toolbox 149
Sequence Diagram Toolbox 150
Common Collaboration and Sequence Diagram Icons 150
Object 150
Messages 151
Message Numbering 153
Assigning an Operation to a Message 153
Collaboration Specific Toolbox Icons 154
Links 154

Sequence Numbering 155


Top-Level Numbering 155
Hierarchical Numbering 155
Scripts 156

Focus of Control 157


Displaying Focus of Control 158
Coloring Focus of Control 158
Moving the Focus of Control 159
Nested Focus of Control 159

Rational Rose 2000, Using Rose xi


Creating Alternative Diagrams 159
Creating a Collaboration Diagram from a Sequence Diagram 159
Creating a Sequence Diagram from a Collaboration Diagram 160

Object Specification 160


Object Specification—General Tab 161
Name 161
Class 162
Persistence Field 162
Multiple Instances Check Box 162

Class Instance Specifications 163


Class Instance Specification—General Tab 163
Class 164

Link Specification 164


Link Specification—General Tab 165
Assoc 165
Supplier & Client Visibility 166
Shared 167
Role 167
Link Specification—Messages Tab 168
Icon 168
Sequence 168
Message Name 169
Receiver 169

Message Specification 169


Message Specification—General Tab 170
Class 170
Message Specification—Detail Tab 171
Synchronization 172
Frequency 172

Chapter 10 Component Diagrams and Specifications 173


Component Diagram Overview 173
Creating and Displaying a Component Diagram 174
Component Diagram Toolbox 174
Assigning a Component to Another Package 174

xii Rational Rose 2000, Using Rose


Component Specifications 175
Component Specification—General Tab 176
Stereotype (Component) 176
Language 176
Component Specification—Detail Tab 177
Declarations 178
Component Specification—Realizes Tab 178
Show all Classes 179
Classes 179
Language 179
Component Specification—Files Tab 179

Package Specification 180


Package Specification—General Tab 180
Package 181
Package Specification—Detail Tab 181
Component Diagrams 181
Package Specification—Realizes Tab 182
Package Specification—Files Tab 182

Chapter 11 Deployment Diagrams and Specifications 183


Deployment Diagram Overview 183
Creating and Displaying a Deployment Diagram 184
Deployment Diagram Toolbox 184

Processor Specification 184


Processor Specification—General Tab 185
Processor Specification—Detail Tab 186
Characteristics 186
Processes 187
Scheduling 187

Device Specification 188


Device Specification—General Tab 188
Device Specification—Detail Tab 189

Connection Specifications 189

Rational Rose 2000, Using Rose xiii


Process Specification 190
Process Specification—General Tab 190
Processor 191
Priority 191

Chapter 12 Framework Wizard Add-In 193


Activating the Framework Wizard Add-In 193

Creating a New Model from a Framework 194

Creating and Deleting Frameworks 195


The Framework Library 195
Creating a New Framework 196
Changing or Deleting a Framework 198

Chapter 13 Type Library Importer 199


What Is a Type Library? 200

Why Would I Want to Import Type Libraries into the Model? 200

What COM Components Can Be Imported into the Model? 200

How Is a Type Library Presented? 201


A Type Library in Rational Rose 201
A Type Library in the OLE Viewer in Visual Studio 206
A Type Library in the Object Browser in Visual Basic 207

Importing a Type Library Into the Model 208

Importing a New Version of an Existing Type Library 209

Hiding Type Library Items 210


Show Hidden Items Selected 210
Show Hidden Items Cleared 211

Using an Imported Type Library 212

Adding Class Members to a Quick Import Type Library 212

Customizing the Type Library Importer 213

xiv Rational Rose 2000, Using Rose


Chapter 14 Stereotypes 217
Overview 217
Benefits to Using Stereotypes 217
User-Defined Stereotypes 218

Viewing Stereotypes 219


Diagram Tab 219
Browser Tab 220

Creating Stereotypes 221


Creating a New Stereotype for the Current Model 221
Creating a New Stereotype Configuration File 221
Creating a New Stereotype for All Rose Models 222
Creating Stereotype Icons 224
Creating a Diagram Icon 224
Creating Diagram Toolbox and List View Icons 225

Adding Stereotypes to the Diagram Toolbox 226

Chapter 15 Data Definition Language (DDL) Generation 227


Overview 227
Object Orientation with Databases 228
DDL Extended Three Schema Model 228
Use of Object Identifiers 228
Logical Views 229
Packages 229
Classes 229
Attributes 230
Association Relationships 232
Controlling DDL Generation 236
DataBase 236
PrimaryKeyColumnKey 236
PrimaryKeyColumnType 236
ViewName 236
TableName 236
InheritSuffix 237
DropClause 237
DDLScriptFileName 237
Generating DDL 237

Rational Rose 2000, Using Rose xv


Chapter 16 Microsoft Repository Integration Add-In 239
The Differences Between Publish to VCM and Export to
Repository 239

Activating the Repository Add-In 240

Publishing a Model to Visual Component Manager 240

Exporting a Model to the Microsoft Repository 241

Importing a Model from the Microsoft Repository 241

Browsing a Published Model in Visual Component Manager 242

Importing Model Elements from Visual Component Manager 243

Chapter 17 Team Development 245


Controlled Units 246
What Can Be Placed Under Version Control? 246
How Are Controlled Units Related? 247
How Are Controlled Units Protected? 248

Setting Up a Multiuser Environment 248


Setting Up a Multiuser Environment (General Steps) 249
Setting Up a Multiuse Environment (Steps to Be Performed by Each
Team Member) 250
Creating a Custom Version Control Integration 252

Working with Controlled Units 252


Organizing a Model in Controlled Units 253
Designating a Package as a Controlled Unit 256
Browsing Controlled Units 258
Browsing Controlled Units in the Browser 259
Browsing Controlled Units in Diagrams 259
Loading and Unloading Controlled Units 260
Loading or Reloading a Specific Controlled Unit 260
Unloading a Controlled Unit 260
Modifying and Saving Controlled Units 261
Modifying a Controlled Unit 261
Saving a Controlled Unit to Its Associated File 261
Saving a Controlled Unit to a New File 261
Uncontrolling Controlled Units 262

xvi Rational Rose 2000, Using Rose


Splitting a Controlled Unit 262
Splitting a Controlled Unit into Two Units 263
Dividing the Contents of a Controlled Unit into Two Sub-
Units 264
Merging Controlled Units 264
Importing a Controlled Unit from Another Model 265
Write Protecting Controlled Units 265
Write-Protecting a Controlled Unit 266
Allowing Modification of a Controlled Unit 266
Creating a Controlled Unit of the Model Properties 267

Virtual Path Maps 268


How Do Virtual Paths Work? 268
Defining Virtual Paths 269
Defining a Path Map Relative to the Location of the Model File 270
Defining a Path Map Using Another Path Map Symbol 270
Defining a Parameterized Path Map 271
Using Virtual Paths in the Value of a Model Property 271

Using Rational Rose in a Team 272


Example project description 272
One Team Member Allowed to Work on a Unit at a Time 273
Multiple Team Members Allowed to Simultaneously Work on the
Same Unit 275

Chapter 18 Version Control Add-Ins 277


Partitioning a Model for Version Control 277

About the Version Control Add-In 278

About the ClearCase Add-In 279

Prerequisites 279

Setting Up Your Version Control System 280


Setting Up ClearCase 280
Setting Up Microsoft Visual SourceSafe 281
Setting Up Other Version Control Systems 283

Choosing and Activating a Version Control Add-In 283

Rational Rose 2000, Using Rose xvii


Using Version Control with a Previously Controlled Model 284

Checking Out Controlled Units 285

Checking In Controlled Units 287

Undoing the Check-Out of Controlled Units 288

Getting the Latest Version of Controlled Units 289

Removing Controlled Units from Version Control 289

Displaying Version Control System Information 291


General Tab 291
Log Tab 292

Frequently Asked Questions About Version Control Add-Ins 292

Chapter 19 Model Integrator 297


Comparing or Merging Contributor Files 298

Specifying Contributor Files 298

Loading and Unloading Subunits 300

Setting a New Context for Model Subunits 301

Interpreting Results and Accepting Changes 302


Interpreting Results 302
Differences and Conflicts 303
Switching Between Compare and Merge Mode 304
Accepting Changes 305

Appendix A Upgrading From a Previous Release 307


Upgrading from Rational Rose 3.0 or Later 307

Upgrading from Releases Prior to Rational Rose 3.0 307

xviii Rational Rose 2000, Using Rose


Appendix B Contacting Technical Support 309
When Contacting Rational Technical Support 309

How to Contact Rational Customer Support 310

Telephone and E-mail 310

Fax 311

Rational Web Site 311

Rational Technical Support Call Center Contact Information 311


North America 311
Europe 311
Asian Pacific 312

Index 313

Rational Rose 2000, Using Rose xix


List of Figures

Figure 1 Application Window 8


Figure 2 Standard Toolbar 9
Figure 3 Application Window 22
Figure 4 Browser—Collapsed and Expanded Tree 23
Figure 5 Navigating a Model 25
Figure 6 Diagram Window 32
Figure 7 Multiple Diagrams—Cascade Windows 33
Figure 8 Multiple Diagrams—Tiled Windows 34
Figure 9 Selected Elements in a Diagram 37
Figure 10 General Tab 49
Figure 11 Detail Tab 51
Figure 12 Files Tab 52
Figure 13 Tab Buttons 53
Figure 14 Class Diagram Example 58
Figure 15 Class Diagram Toolbox 59
Figure 16 Class Specification—General Tab 62
Figure 17 Class Specification—Detail Tab 64
Figure 18 Class Specifications—Operations Tab 69
Figure 19 Class Specification—Attributes Tab 71
Figure 20 Class Specification—Relations Tab 73
Figure 21 Class Specification—Component Tab 74
Figure 22 Class Specification—Nested Tab 76
Figure 23 Class Attribute—General Tab 78
Figure 24 Class Attribute—Detail Tab 80
Figure 25 Operations Specification—General Tab 83

Rational Rose 2000, Using Rose xxi


List of Figures

Figure 26 Operation Specification—Detail Tab 84


Figure 27 Operation Specification—Precondition Tab 87
Figure 28 Operations Specification—Semantics Tab 88
Figure 29 Operation Specification—Postcondition Tab 89
Figure 30 Parameter Specification—General Tab 91
Figure 31 Association Specification—General Tab 93
Figure 32 Association Specification—Detail Tab 94
Figure 33 Association Specification—Role A and B General Tab 96
Figure 34 Association Specification—Role A and B Detail Tab 97
Figure 35 Generalize Specification—General Tab 100
Figure 36 Dependency Specification—General Tab 101
Figure 37 Package Specification—General Tab 103
Figure 38 Package Specification—Detail Tab 104
Figure 39 Has Specification—General Tab 106
Figure 40 Has Specification—Detail Tab 107
Figure 41 Key/Qualifier Specification—General Tab 109
Figure 42 Use-Case Diagram Toolbox 115
Figure 43 Use-Case Specification—General Tab 116
Figure 44 Use-Case Specification—Diagram Tab 117
Figure 45 Use-Case Specification—Relations Tab 118
Figure 46 Generalize Specification—General Tab 119
Figure 47 State Machine Specification—General Tab 122
Figure 48 Automatic Transmission Example 124
Figure 49 Swimlane Specification—General Tab 131
Figure 50 State and Activity Specification—General Tab 132
Figure 51 State and Activity Specification—Actions Tab 133
Figure 52 State and Activity Specification—Transitions Tab 134
Figure 53 State and Activity Specification—Swimlanes Tab 135
Figure 54 State Transition Specification—Detail Tab 138
Figure 55 Decision Specification—General Tab 140
Figure 56 Decision Specification—Transition Tab 141
Figure 57 Decision Specification—Swimlane Tab 142
Figure 58 Synchronization Specification—General Tab 143
Figure 59 Synchronization Specification—Transitions Tab 144
Figure 60 Collaboration Diagram Example 147
Figure 61 Sequence Diagram Example 148

xxii Rational Rose 2000, Using Rose


Figure 62 Collaboration Diagram Toolbox 149
Figure 63 Sequence Diagram Toolbox 150
Figure 64 Multiple Object Diagram 151
Figure 65 Focus of Control Diagram Example 158
Figure 66 Object Specification—General Tab 161
Figure 67 Class Instance Specification—General Tab 163
Figure 68 Link Specification—General Tab 165
Figure 69 Link Specification—Message Tab 168
Figure 70 Message Specification—General Tab 170
Figure 71 Message Specification—Detail Tab 171
Figure 72 Component Diagram Example 173
Figure 73 Component Diagram Toolbox 174
Figure 74 Component Specification—General Tab 176
Figure 75 Component Specification—Detail Tab 177
Figure 76 Component Specification—Realizes Tab 178
Figure 77 Package Specification—General Tab 180
Figure 78 Package Specification—Detail Tab 181
Figure 79 Deployment Diagram Example 183
Figure 80 Deployment Diagram Toolbox 184
Figure 81 Processor Specification—General Tab 185
Figure 82 Processor Specification—Detail Tab 186
Figure 83 Device Specification—General Tab 188
Figure 84 Device Specification—Detail Tab 189
Figure 85 Process Specification—General Tab 190
Figure 86 Create New Model Dialog Box 194
Figure 87 Framework Wizard Specification Page 196
Figure 88 Framework Wizard Summary Page 197
Figure 89 The Component View of the Microsoft Scripting Runtime Type Library 201
Figure 90 The Component Overview Diagram for a Model 202
Figure 91 The Logical View of the Microsoft Scripting Runtime Type Library 202
Figure 92 The Logical Overview Diagram of the Microsoft Scripting Runtime Type
Library 204
Figure 93 The OLE Viewer in Visual Studio 207
Figure 94 The Object Browser in Visual Basic 208
Figure 95 Type Library with Show Hidden Items Option Selected 210
Figure 96 Type Library with Show Hidden Items Option Cleared 211

Rational Rose 2000, Using Rose xxiii


List of Figures

Figure 97 The COM Properties Dialog Box 213


Figure 98 Example of a Diagram with User-Defined Stereotypes 218
Figure 99 Options Dialog Box—Diagram Tab 219
Figure 100 Options Dialog Box—Browser Tab 220
Figure 101 Options Specification—DDL Tab 230
Figure 102 The Visual Component Manager 242
Figure 103 Example of Division of a Model into Controlled Units 247
Figure 104 Status of Selected Controlled Unit Displayed in the Status Bar 248
Figure 105 Virtual Path Map Dialog Box 251
Figure 106 Example of Controlled Units in a Model 253
Figure 107 Sample Add To Version Control Dialog Box 254
Figure 108 Logical Packages in a Model 255
Figure 109 Controlled Units in a Model 255
Figure 110 Unit References When Using the Virtual Path Map “&” 256
Figure 111 Add To Version Control Dialog Box 257
Figure 112 Save Dialog Box 258
Figure 113 Status and File Path of Selected Controlled Unit Displayed in the Status
Bar 259
Figure 114 Splitting a Unit Into Two Units 263
Figure 115 Dividing a Unit Into Two Sub-Units 264
Figure 116 Virtual Path Map Dialog Box 269
Figure 117 Controlled Units of the Example Model 272
Figure 118 SourceSafe Options Dialog Box 282
Figure 119 Sample Check-out Dialog Box 285
Figure 120 Sample Check-in Dialog Box 287
Figure 121 Sample Version Control Options Dialog Box 291

xxiv Rational Rose 2000, Using Rose


List of Tables

Table 1 Print Dialog Box Tabs 17


Table 2 Browser to Browser Capabilities 27
Table 3 Browser to Diagram Capabilities 28
Table 4 Browser to Specification Capabilities 29
Table 5 Export Control Field Options 63
Table 6 Cardinality Field Options 65
Table 7 Persistence Field Options 66
Table 8 Class Concurrency Options 67
Table 9 Physical Containment Options 81
Table 10 Concurrency Field Options 86
Table 11 Containment Field Options 99
Table 12 Persistence Field Options 162
Table 13 Supplier & Client Visibility Options 166
Table 14 Synchronization Options 172
Table 15 Frequency Options 172
Table 16 Scheduling Field Options 187
Table 17 COM Stereotypes 205

Rational Rose 2000, Using Rose xxv


Preface

The Rational Rose 2000, Using Rose manual provides important usage
and reference information to effectively use Rational Rose. This
manual is designed for all users of Rational Rose, and provides
information on the following Rational Rose features and concepts:
■ Diagrams
■ Specifications
■ Team Development
■ The Browser
■ Standard Rational Rose Add-Ins
The Rational Rose 2000, Using Rose manual does not contain
information on these add-ins. For more information on these add-ins,
refer to the language-specific documentation shipped with this edition.
To use Rational Rose 2000, you should be comfortable with basic
Windows techniques, including using a mouse.
Rational Rose includes an online tutorial which provides a hands-on
introduction to the core features. However, the primary source of
reference is the online help.

How this Manual is Organized


Chapter 1Introduction to Visual Modeling Using Rational Rose

Introduces you to Visual Modeling and Rational Rose. It also gives a


brief explanation of UML Notation and describes the many features of
Rational Rose.

Rational Rose 2000, Using Rose xxvii


Preface

Chapter 2Getting Started with Rational Rose

Describes how the Rational Rose graphical user interface displays,


creates, modifies, manipulates, and documents the elements of a
model using the Application, Documentation, Diagram, and
Specification windows.
Chapter 3The Browser

Explains the various capabilities of the browser including navigating a


model and drag-and-drop.
Chapter 4Introduction to Diagrams

Explains how to create, display and modify diagrams in a model.


Chapter 5Introduction to Specifications

Explains how to display and edit a specification. Also, this chapter


explains the common elements of a specification and how to navigate
the default tabs.
Chapter 6Class Diagrams and Specifications

Describes the class diagram, the class specification and all of the
specifications that derive from a class diagram. The Class Attribute,
Operation, Association, Generalize, Dependency, Logical Package, Has
Relationship, and Key/Qualifier Specifications are all described in this
chapter.
Chapter 7Use-Case Diagrams and Specifications

Explains how use-case diagrams graphically depict system behavior.


Also, this chapter lists the features of the Use-Case and Actor
Specifications.
Chapter 8-State Machine Diagrams and Specifications

Describes the two diagrams contained within a state machine:


statechart diagrams and activity diagrams. The chapter explains the
concept of workflow modeling in activity diagrams. The chapter also
explains the specifications and model elements associated with
statechart and activity diagrams.

xxviii Rational Rose 2000, Using Rose


How this Manual is Organized

Chapter 9Interaction Diagrams and Specifications

Describes the differences and similarities between collaboration and


sequence Diagrams. The chapter also explains Focus of Control,
Message Numbering, and the various specifications associated with
both diagrams.
Chapter 10Component Diagrams and Specifications

Explains the component diagram and toolbox. The chapter also


describes the Component and Package Specifications.
Chapter 11Deployment Diagrams and Specifications

Provides an overview of the deployment diagram and explains the


Processor, Device, Connection and Process Specifications.
Chapter 12Framework Add-In

Provides instruction on activating the Framework Add-In, creating a


new model from a framework, and deleting a framework. The chapter
also describes the framework library.
Chapter 13 Type Library Importer

The Type Library Importer Add-In allows you to import the type library
of COM (Component Object Model) components into your model by
dragging the file from the Windows Explorer and drop it in Rational
Rose.
Chapter 14Stereotypes

Describes the benefits of using stereotypes and how to create user-


defined stereotypes. Also, the chapter explains how to create and add
stereotypes to a model.
Chapter 15Data Definition Language (DDL) Generation

Provides an overview of DDL generation. The chapter also describes the


following pertinent elements of the logical view: Packages, Classes,
Attributes, and Association Attributes. It also explains the project
properties that help tailor DDL generation.
Chapter 16Microsoft Repository Integration Add-In

Explains the difference between publish and export. The chapter also
explains how to publish, browse, and import a model with a Visual
Component Manager and how to export and import a model with the
Microsoft Repository.

Rational Rose 2000, Using Rose xxix


Preface

Chapter 17Team Development

Provides an overview of how to develop a model with teams of analysts,


architects, and software developers. The chapter also explains
Controlled Units, Virtual Path Maps, Write Protection, and how to
prepare and use a model in a team development environment.
Chapter 18Version Control Add-In

Explains how to use version control software like ClearCase or


Microsoft Visual Source Safe with Rational Rose. The chapter also
explains how to manipulate controlled units with the Version Control
Add-In.
Chapter 19Model Integrator

This chapter describes the Rose Model Integrator, which lets you
compare model elements from up to seven contributor files, discover
their differences, and merge them into the base model.

Online Help
The Rational Rose 2000 software includes comprehensive online help
with hypertext links and a two-level search index.

Online Manual
Rational Rose 2000 includes version of all the user manuals online.
Please refer to the Readme.txt file (found in the Rational Rose
installation directory) for more information.

xxx Rational Rose 2000, Using Rose


Related Documentation

Related Documentation
After installation and before you begin using Rational Rose, please
review any readme.txt files and Release Notes to ensure that you
have the latest information about the product. The release notes are
included with your product documentation and are available online
from the Start menu.
For additional resources on UML, Visual Modeling, and Rational Rose,
refer to the following publications:
■ Quatrani, Terry. Visual Modeling with Rational Rose and
UML.Reading, MA. Addison Wesley Longman, Inc., 1998 (Included
with product documentation).
This book introduces the most popular and influential
elements-the Rational Objectory Process, the Unified Modeling
Language (UML), and Rational Rose—and offers practical
direction on specifying visualizing, documenting, and creating
software solutions.
■ Kruchten, Philippe. The Rational Unified Process - An
Introduction.Reading, MA. Addison Wesley Longman, Inc., 1998.
This book introduces you to the Rational Unified Process (RUP).
■ Booch, Grady; Rumbaugh, James; Jacobson, Ivar. The Unified
Modeling Language User Guide. Reading, MA. Addison Wesley
Longman, Inc., 1999.
This book teaches you how to use and apply the Unified
Modeling Language.

File Names
Where file names appear in examples, Windows syntax is depicted. To
obtain a legal UNIX file name, eliminate any drive prefix and change the
backslashes to slashes:
c:\project\username
becomes
/project/username

Rational Rose 2000, Using Rose xxxi


Preface

Starting Rational Rose


On start-up, Rational Rose extracts information from the registry and
from the rose.ini file. The rose.ini file is typically located in your
Rational Rose installation directory on Windows platforms, or .rose.ini
in your home directory on UNIX platforms. As the syntax and
semantics of these files are identical, both files will subsequently be
referred to as .ini files. For more information on the rose.ini file, refer
to the online help.

Registration
Please send in your registration card as soon as you unpack your copy
of Rational Rose. This will ensure that you receive all notices and
update announcements, as well as information on new products that
can be used with Rational Rose. Proper registration is also required to
use Rational Rose Technical Support.

xxxii Rational Rose 2000, Using Rose


Chapter 1

Introduction to Visual Modeling Using


Rational Rose

Rational Rose provides support for two essential elements of modern


software engineering: component based development and controlled
iterative development. While these concepts are conceptually
independent, their usage in combination is both natural and
beneficial. [Rational Rose’s model-diagram architecture facilitates use
of the Unified Modeling Language (UML), Component Object Modeling
(COM), Object Modeling Technique (OMT), and Booch ‘93 method for
visual modeling. Using semantic information ensures correctness by
construction and maintaining consistency.]

Visual Modeling
Increasing complexity, resulting from a highly competitive and ever-
changing business environment, offers unique challenges to system
developers. Models help organize, visualize, understand, and create
complex things.
Visual Modeling is the mapping of real world processes of a system to
a graphical representation. Models are useful for understanding
problems, communicating with everyone involved with the project
(customers, domain experts, analysts, designers, etc.), modeling
complex systems, preparing documentation, and designing programs
and databases. Modeling promotes better understanding of
requirements, cleaner designs, and more maintainable systems.

Rational Rose 2000, Using Rose 1


Chapter 1 Introduction to Visual Modeling Using Rational Rose

As software systems become more complex, we cannot understand


them in their entirety. To effectively build a complex system, the
developer begins by looking at the big picture without getting caught
up in the details. A model is an ideal way to portray the abstractions of
a complex problem by filtering out nonessential details. The developer
must abstract different views or blueprints of the system, build models
using precise notations, verify that the models satisfy the requirements
of the system, and gradually add detail to transform the models into an
implementation.
The models of a software system are analogous to the blueprints of a
building. An architect could not design a structure in its entirety with
one blueprint. Instead a blueprint is drawn up for the electrician, the
plumber, the carpenter, and so on. When designing a software system
the software engineer deals with similar complexities. Different models
are drawn up to serve as blueprints for marketing, software developers,
system developers, quality assurance engineers, etc. The models are
designed to meet the needs of a specific audience or task, thereby
making them more understandable and manageable.
Visual modeling has one communication standard: Unified Modeling
Language (UML). The UML provides a smooth transition between the
business domain and the computer domain. By communicating with
the UML, all members of a design team work with a common
vocabulary, minimizing miscommunication and increasing efficiency.
Visualizing the components and relationships of a complex system
make it far easier to understand than describing it with words.
Visual modeling captures business processes by defining the software
system requirements from the user’s perspective. This streamlines the
design and development process. Visual modeling also defines
architecture by providing the capability to capture the logical software
architecture independent of the software language. This method
provides flexibility to your system design since the logical architecture
can always be mapped to a different software language. Finally, with
visual modeling you can reuse parts of a system or an application by
creating components of your design. These components can then be
shared and reused by different members of a team allowing changes to
be easily incorporated into already existing development software.

2 Rational Rose 2000, Using Rose


Modeling with Rational Rose
Rational Rose is the visual modeling software solution that lets you
create, analyze, design, view, modify and manipulate components and
implement systems in a way that makes them truly easy to
communicate. You can graphically depict an overview of the behavior
of your system with a use-case diagram. Rational Rose provides the
collaboration diagram as an alternate graphical representation of a
use-case diagram. It shows object interactions organized around
objects and their links to one another. And the state transition diagram
provides additional analysis techniques for classes with significant
dynamic behavior. A statechart diagram shows the life history of a
given class, the events that cause a transition from one state to
another, and the actions that result from a state change. Activity
diagrams provide a way to model the workflow of a business process or
a way to model a class operation.
Rational Rose provides the notation needed to specify and document
the system architecture. The logical architecture is captured in class
diagrams that contain the classes and relationships that represent the
key abstractions of the system under development. The component
architecture is captured in the component diagrams that focus on the
actual software module organization within the development
environment. The deployment architecture is captured in a deployment
diagram that maps software to processing nodes - it shows the
configuration of run-time processing elements and the software
processes living in them.
Rational Rose lets you realize all the benefits of visual modeling. It is
designed to provide software developers with a complete set of visual
modeling tools for development of robust, efficient solutions to real
business needs.

Rational Rose 2000, Using Rose 3


Chapter 1 Introduction to Visual Modeling Using Rational Rose

Notations
Notation plays an important part in any application development
activity—it is the glue that holds the process together. UML provides a
very robust notation, which grows from analysis into design. Certain
elements of the notation (that is, use cases, classes, associations,
aggregations, inheritance) are introduced during analysis. Other
elements of the notation (that is, containment indicators and
properties) are introduced during design.
Notation has three roles. It:
■ Communicates decisions that are not obvious or cannot be inferred
from the code itself
■ Provides semantics that capture important strategic and tactical
decisions
■ Offers a concrete form and tools to manipulate

Features
Rational Rose provides the following features to facilitate the analysis,
design, and iterative construction of your applications:
■ Use-Case Analysis
■ Object-Oriented Modeling
■ User-Configurable Support for UML, COM, OMT, and Booch ‘93
■ Semantic Checking
■ Support for Controlled Iterative Development
■ Round-Trip Engineering
■ Parallel Multiuser Development through Repository and Private
Support
■ DDL Generation and Integration with Data Modeling Tools
■ Forward Engineering of CORBA-2 Compliant IDL
■ Documentation Generation
■ Rational Rose Scripting for integration and extensibility
■ OLE Linking
■ OLE Automation
■ Multiple Platform Availability

4 Rational Rose 2000, Using Rose


Extending Rational Rose
The add-in feature allows you to quickly and accurately customize your
Rational Rose environment depending on your development needs.
Using the add-in tool, you can install language (for example, Visual
Basic, Visual Java, etc.) and non- language (for example Microsoft
Project) tools while in Rational Rose.
When an add-in is installed, it is automatically in an activated state.
Add-Ins can install:
■ Menus (.mnu file)
■ Help files (.hlp file)
■ Contents tab file (.cnt file)
■ Properties (.pty file)
■ Executables (.exe)
■ Script files (.ebs script source file and .ebx compiled script file)
■ OLE servers (.dll file)
Additionally, an add-in can define fundamental types, predefined
stereotypes, and metafiles. Note that an add-in is not to be considered
strictly a one-to-one association with a round-trip engineering (RTE)
integration.

Add-In Manager

The Add-In Manager allows you to control the state of the add-in,
whether it is activated or deactivated. If the add-in is deactivated, it is
still visible through the Add-In Manager. However, the add-in’s
properties and menus are not available.

Installing an Add-In

Use the following steps to install an add-in on your Windows 95,


Windows 98, or Windows NT system:
1. Exit Rational Rose.
2. Insert the application’s CD ROM that you wish to install.
3. Run the setup.exe program.
4. Respond to the dialogs to complete your installation.
5. Restart Rational Rose. Confirm that your add-in is activated using
the Add-In Manager menu.

Rational Rose 2000, Using Rose 5


Chapter 2

Getting Started with Rational Rose

When you first start Rational Rose, some editions will display a
Framework dialog box. From this dialog box, you can load a model with
predefined model elements, allowing you to focus your modeling efforts
on the parts that are unique to your system, instead of “reinventing the
wheel.” For further information on the Framework Wizard, refer to the
Chapter 12, Framework Wizard Add-In.
Independent of Frameworks, Rational Rose’s graphical user interface
displays, creates, modifies, manipulates, and documents the elements
in a model using four kinds of windows:
■ Application window
■ Documentation window
■ Diagram window
■ Specification window
Rational Rose displays the diagram, specification and documentation
windows within the application window.

Rational Rose 2000, Using Rose 7


Chapter 2 Getting Started with Rational Rose

The Application Window


An application window contains a control-menu box, a menu bar, a
title bar, a toolbar, a toolbox, a minimize button, a maximize button,
the browser, and the documentation window.

Control-Menu Box Minimize Maximize


Button Button Close
Toolbox Title Bar Button
Menu Bar

Toolbar
Diagram
Window

Browser

Specification
Window

Documentation
Window

Figure 1 Application Window

Control-Menu Box
Clicking the Control-Menu Box (on the application or diagram window)
displays a drop-down list box with the following options:
Restore: Restores focus to that diagram window.
Move: Highlights the border of the window. Move your pointer to the
Title Bar, click and drag the window to the desired location.
Size: Highlights the border of the window. Move your pointer to the
border and resize the window as desired.
Minimize: Reduces the window to an icon placing it in the bottom of the
application window.

8 Rational Rose 2000, Using Rose


The Application Window

Maximize: Enlarges the window to consume the entire screen.


Close: Closes the window.

Title Bar
The title bar always displays diagram type. Additional information (like
the view or diagram name) is often displayed depending on the
diagram/model being viewed.

Minimize and Maximize Button


These buttons allow you to minimize or maximize the diagram or
application window.

Menu Bar
The menu bar changes depending on which diagram you are currently
working on. For more information regarding the menu bar see the
Diagram Overview chapter later in this manual.

Toolbar
The standard toolbar is displayed directly under the menu bar, along
the top of the application window. This toolbar is independent of the
open diagram window.
The following icons are available for use on the standard toolbar,
independent of the diagram window open. An explanation of each
follows.

Figure 2 Standard Toolbar

Create New Model

Clicking the New File icon creates a new model.

Rational Rose 2000, Using Rose 9


Chapter 2 Getting Started with Rational Rose

Open Existing Model

Clicking the Open Model icon from the toolbar opens the Load Model dialog
box. You can open a model from anywhere within the design.
Create and Open icons: If you have a model open when you click
either the Create or Open icon, you are asked to save your current
model. Clicking No discards all changes since your last save.
Clicking Yes saves your changes and opens a new model, or
displays the Load Model dialog box automatically.

Save Model or Log


Clicking the Save Model icon opens the Save Model to dialog box. Enter a
new file name. After the model is named and saved, clicking this icon
automatically saves your changes to the current model without
displaying the dialog box. This will also save the log if the log window
is open.

Cut
Clicking the Cut icon removes icons from your model. Element(s) must
be selected to activate the icon. Cutting an element will also cut
associated relationships. You can cut multiple selected items.

Copy

Clicking the Copy icon copies an element to a new location on the same
model, or to a new model, without affecting the original model.

Paste

Clicking the Paste icon pastes a previously cut or copied element to the
clipboard onto another location.

Print Diagrams

Clicking the Print icon prints diagrams to the default printer.


Context Sensitive Help

Clicking the Context Sensitive Help icon makes all topics covered in the on-
line help material available. Click on this icon, drag to the item and
release the mouse.

10 Rational Rose 2000, Using Rose


The Application Window

View Documentation

Clicking the View Documentation icon displays the documentation window


on the diagram.

Browse Class Diagram

Clicking the Browse Class Diagram icon opens the Select Class Diagram dialog
box.

Browse Interaction Diagram

Clicking the Browse Interaction Diagram icon opens the Select Interaction
Diagram dialog box.

Browse Component Diagram

Clicking the Browse Component Diagram icon opens the Select Component
Diagram dialog box.

Browse State Machine Diagram

Clicking the Browse State Machine Diagram icon opens the Select Statechart
Diagram or Activity Diagram dialog box.

Browse Deployment Diagram

Clicking the Browse Deployment Diagram icon opens the Deployment Diagram
dialog box.

Browse Use-Case Diagram

Clicking the Browse Use-Case Diagram icon opens the Selected Use Case
Diagram dialog box.

Browse Parent

Clicking the Browse Parent icon displays the “parent” of the selected
diagram or specification. If you have a specification selected, the
specification for the parent of the “named” item is displayed.

Rational Rose 2000, Using Rose 11


Chapter 2 Getting Started with Rational Rose

Browse Previous Diagram

Clicking the Browse Previous Diagram icon displays the last displayed
diagram.

Zoom In

Clicking the Zoom In icon magnifies the current diagram to view an area
in detail.

Zoom Out

Clicking the Zoom Out icon minimizes the current diagram allowing you
to “pull back” to view more information.

Fit in Window

Clicking the Fit In Window icon centers and displays any diagram within
the limits of the window. This command changes the zoom factor so
that the entire diagram shows.

Undo Fit in Window

Clicking the Undo Fit In Window icon undoes the actions performed on the
previous Fit In Window command.

List Help Topics

Clicking the List Help Topics icon brings up the online help contents.

Toolbox
The diagram toolbox consists of tools that are appropriate for the
current diagram. Changing diagrams automatically displays the
appropriate toolbox.
When a modifiable diagram window is active, a toolbox with tools
appropriate for the current diagram is displayed. If the current
diagram is contained by a controlled unit or the model is write-
protected, the toolbox is not displayed.

12 Rational Rose 2000, Using Rose


The Application Window

While each diagram has a set of tools applicable for the current
diagram, all toolboxes have the following three icons:
■ Selector Icon
■ Separator Icon
■ Lock Icon

Selector Icon

The selector icon (as the name implies) is used to select icons on the
diagram. This icon cannot be removed from the toolbox.

Separator Icon

The separator icon (again, as the name implies) is used to put a small
space between icons on the toolbox. You can have as many as you
want, but one must always remain on the toolbox.

Lock Icon

This icon can be set to locked or unlocked. In the locked mode, any
tool icon stays in the selected state until the diagram loses focus or
another tool button is selected. This option facilitates the rapid
placement of several identical icons without repeatedly returning to the
diagram toolbox.
This icon is usually not displayed, but you can add it to the toolbox.
See Customizing the Toolbox below.
You can obtain the lock functionality without the icon through the
shortcut menu or by pressing the SHIFT key while placing an element.
Releasing the SHIFT deactivates the lock feature.
The toolbox for each diagram type is discussed in the appropriate
chapter.
Note: You can also extend the toolbox. This allows you to view
stereotype icons and additional tools if applicable. See the Stereotype
chapter for more details.

Rational Rose 2000, Using Rose 13


Chapter 2 Getting Started with Rational Rose

Customizing the Toolbox


You can access the Customize Toolbar dialog box to modify the displayed
toolbox using any of the following methods:
■ Right-click anywhere on the toolbox and then click Customize from
the shortcut menu.
■ Double-click anywhere on the toolbox not occupied by a button.
■ Click View > Toolbars > Configure.
■ Click Tools > Options. On the Option dialog box, click Toolbars. This
approach gives you the ability to modify all the diagram toolboxes
without first displaying a specific diagram type.

Browser
The browser is a hierarchical navigational tool that allows you to view
the names and icons of interaction, class, use case, statechart, activity,
and deployment diagrams as well as many other model elements.
When a class or interface is assigned to a component, the browser
displays the assigned component name in an extended name. The
extended name is a comma-spread list within parenthesis to the right
of the class and interface name. The extended list includes all the
assigned components.
For additional information on the workings of the browser, refer to the
chapter entitled The Browser.

Documentation Window
The documentation window is used to describe model elements or
relationships. The description can include such information as the
roles, keys, constraints, purpose, and essential behavior of the
element. You can type information in this free-form text either here or
through the documentation field of a specification.
To view the documentation window, click View > Documentation. A check
mark next to documentation indicates the window is opened.
Only one documentation window can be open at one time, but as you
select different items, the window will be updated accordingly.

14 Rational Rose 2000, Using Rose


Diagram Window

When the window is first displayed, it will be docked to the lower left
corner. To move the window, click and drag on the border. The window
outline indicates the window state: a thin, crisp line indicates the
window will be docked, while a thicker, hashmark-type border
indicates it will be floating.
Characteristics unique to the window state (docked or floating) are
discussed below:

Docked

■ The window can be moved within the dockable region of the model,
but it remains positioned along the border.
■ The size remains fixed.
■ The title can be displayed through a tool tip (simply place your
pointer anywhere in the window).
■ The window may be docked at any time.

Floating

■ The window can be moved to any location, and is always displayed


on top of the diagram.
■ Size can be changed via click and drag along the border in a
vertical or horizontal direction.
The window title displays the type (class or object) and the name of the
class or object.

Diagram Window
Diagram windows allow you to create and modify graphical views of the
current model. Each icon in a diagram represents an element in the
model. Since diagrams are used to illustrate multiple views of a model,
each model element can appear in none, one or several of a model’s
diagrams. This means you can control which elements and properties
appear on each diagram.

Rational Rose 2000, Using Rose 15


Chapter 2 Getting Started with Rational Rose

Diagrams are contained by the model elements they represent:


■ A logical package (also User Services, Business Services, and Data
Services) contains an automatically created class diagram called
“Package Overview,” and user created class diagrams, collaboration
diagrams, interaction diagrams, and three-tiered diagrams.
■ A component package contains component diagrams.
■ A class contains its state diagrams.
■ A model contains the diagram for its top level components, its
three-tiered service model diagram, its deployment diagram, and
the diagram contained by its logical package and component
packages. These top-level components can be classes, components,
devices, connections, and processors.

Overview Window
The Overview Window is a navigational tool that helps you move to any
location on all Rational Rose diagrams. When a diagram is larger than
the viewable area within the diagram window, it is not possible to see
the whole diagram without scrolling. The overview window provides a
scaled-down view of the current diagram so you can see the entire
diagram.
To move to an exact area of your diagram, use the following steps:
1. Move the pointer over the hand located in the lower, right-side
of the diagram window. Notice how the pointer appears as a + when
the pointer is located over the active hand.
2. Click on the hand icon so the overview window appears.
3. Hold down the mouse button and move the box inside the overview
window to a desired diagram location.
Note: The Overview Window closes automatically when you release the
mouse button.

16 Rational Rose 2000, Using Rose


Specification Window

Specification Window
A specification enables you to display and modify the properties and
relationships of a model element, such as a class, a relationship, an
operation, or an activity. The information in a specification is presented
textually; some of this information can also be displayed inside icons
representing the model element in diagrams.
You can change properties or relationships by editing the specification
or modifying the icon on the diagram. The associated diagram or
specification is automatically updated.
To display a specification, click the icon in either the diagram or the
browser and use one of the following methods:
■ Right-click to display the shortcut menu.
■ Click Browse > Specification.
■ Double-click on the icon (if you have not executed the Double-Click to
Diagram command).
The specifications are displayed as tabs and you can easily navigate
through them.

Printing Diagrams and Specifications


The Print dialog box allows you to print diagrams and specifications.
The Print dialog box has the following tabs:
Table 1 Print Dialog Box Tabs

General tab Allows you to specify a printer, a selection of diagrams


and specifications, and the number of copies to be
printed.

Diagrams tab Allows you to select and view a list of diagrams to be


printed.

Specifications tab Allows you to select and view a list of specifications to


be printed.

Layout tab Allows you to select layout settings for printing


diagrams and specifications.

Rational Rose 2000, Using Rose 17


Chapter 2 Getting Started with Rational Rose

Print Preview
The Print Preview option enables you to see how a diagram will appear
when printed. Also, print preview displays the total number of pages
the diagram will take to print on the status bar.

Zoom In and Zoom Out


Click either Zoom In or Zoom Out to view a diagram at different magnified
sizes. Also, you can click on any part of the diagram to get a magnified
view.

Print
Click the Print button to display the Print dialog box.

One Page and Two Page


Click Two Page to display the diagram in two pages or click One Page to
view the diagram in one page. When diagrams are viewed in two pages,
the Next Page button becomes active and enables you to view other
pages. The Previous Page button becomes active when there is a
previous page to view.

Close
Click Close to return to an active window.

Apply Filter Dialog Box


The Apply Filter dialog box enables you to search for diagrams and
specifications within your model. The filter is especially useful when
you print diagrams from large models.
To print a specific diagram in a model, type in the name, type, or path
of the diagram you are trying to print.
Name - Provides a list of all diagram names depending on search
criteria.
Type - Provides a list of all diagram types depending on search criteria.
Path - Provides a list of each path for diagrams displayed.

18 Rational Rose 2000, Using Rose


Printing Diagrams and Specifications

Next, press the OK button to locate the diagram. Then, with the
diagram selected, press OK from the Print dialog box to print the
diagram.
To search for a diagram or a specification in the Apply Filter dialog box,
you can use the * (asterisk) wildcard character:
■ A* matches any name beginning with the letter A
■ *A matches any name ending with the letter A
■ *A* matches any name containing the letter A

Rational Rose 2000, Using Rose 19


Chapter 3

The Browser

Overview
The browser is an easy-to-use alternative to menus and toolbars for
visualizing, navigating and manipulating items within your model. The
browser provides:
■ A hierarchical view of many items in a model
■ Drag-and-drop capabilities that change a model’s characteristics
■ Automatic updating of model items to reflect changes in the
browser

Rational Rose 2000, Using Rose 21


Chapter 3 The Browser

Viewing the Browser


When you start Rational Rose, the browser is visible by default. It
appears in docked position, to the left of the toolbox and diagram
windows.

Browser
Window

Figure 3 Application Window

Hiding and Displaying the Browser


To hide (or display) the browser window, on the View menu, click
Browser. A check mark next to the word Browser indicates the browser
is visible.

Positioning the Browser


You can change the size and position of the browser according to your
own preferences. The browser can be:
■ Docked: Positioned along the border with a fixed size
■ Floating: Moved to any location with a variable size

22 Rational Rose 2000, Using Rose


Viewing the Browser

Docking and Undocking the Browser


The browser is in a docked position by default.
To redock the browser:
1. Click on any border of the browser.
2. Drag the browser to any application window border.
To undock the browser:
1. Click on any border of the browser.
2. Drag the browser to the desired position.
3. Resize the browser window, if necessary.
Note: As with any resizeable window, you can resize the browser by
pointing to a border and dragging the pointer to increase or decrease the
window’s dimensions.

Expanding and Collapsing the Browser Tree


The current model’s hierarchy is visible in the tree structure of the
browser window:
■ A plus (+) sign next to an icon indicates that the icon is collapsed,
that is, it contains other model elements. Click the + sign to
expand the icon and view its subordinate items.
■ A minus (−) sign next to an icon indicates that the icon is fully
expanded. Click the minus (−) sign to collapse the item.

Collapsed Tree

Expanded Tree

Figure 4 Browser Collapsed and Expanded Tree

Rational Rose 2000, Using Rose 23


Chapter 3 The Browser

Selecting Multiple Elements in the Browser


You can select multiple elements in the browser to manipulate items
within your model for version control purposes. Version control
functionality is available through the Version Control add-in or
through ClearCase. Selecting multiple elements in the browser enables
you to check in or check out more than one file at a time using a
version control system. When multiple icons are selected, only the
browser options are available on the shortcut menu.
Note: Add-ins have the ability to modify shortcut menus.
Use the following steps to select items in the browser:

Selecting Multiple Items in any Order

1. Select an item in the browser.


2. Hold down the CTRL key.
3. Click each item in the browser that you want to select.
Note: You can deselect an item with the CTRL key depressed.

Selecting Sequential Items

1. Select an item in the browser.


2. Hold down the SHIFT key.
3. Select another item in the browser.
Notice how the browser selects every item between the two items that
you selected.

Navigating a Model
The browser provides a visual representation of your model’s
hierarchy. As you make changes in a diagram window or in the browser
window, the windows remain synchronized:
■ To display a diagram window, double-click on its name or icon in
the browser window.
■ To display an item’s specification, double-click on the item in the
browser or in a diagram window. (Any changes you make to the
specification are automatically reflected in both the browser and
the diagram.)

24 Rational Rose 2000, Using Rose


Viewing the Browser

■ To focus an item in the current diagram, click the item in the


browser or in the diagram window.
The following figure shows My Class1 highlighted in both the browser
and the class diagram:

Figure 5 Navigating a Model

Creating and Editing Model Elements


You can use the drag-and-drop capabilities in the browser to create
and edit model elements in two ways:
■ Drag-and-drop one item in the browser to another item in the
browser. Your diagram will automatically be updated to reflect the
changes in the browser.
■ Drag-and-drop elements from the browser to the appropriate
diagrams.
■ If the class belongs to a parent different from the diagram, and
Show Visibility is on, the class is annotated with the term ‘(from x)’
where x is the class’ location. If Show Visibility is off, only the class
name is displayed.

Rational Rose 2000, Using Rose 25


Chapter 3 The Browser

Naming an Element in the Browser


1. Create or select an element.
2. Type in a new name.
If this name already exists in another package, a warning dialog
is displayed telling you that the name of the element and type
already exist in another package. For example: “Class AA now
exists in multiple name spaces.”
You can dismiss this box by either clicking Cancel which ignores
the name or OK. If you do not want to see this dialog box any
more, select “Don’t warn anymore this session” button. If you
want to start seeing this warning again, you must restart the
application.

Using Drag-and-Drop in the Browser


The drag-and-drop feature allows moving elements within the browser
and from the browser to diagrams and specifications.
Specifically, you can use drag-and-drop to do the following tasks:
■ Assign classes and interfaces to components
■ Move class operations and attributes between classes
■ Move class diagrams, sequence and collaboration diagrams
between packages
■ Move component diagrams between component packages
■ Move nested classes from one specification to another
■ Place components and component packages on component
diagrams
■ Place classes interfaces and component packages on class
diagrams
■ Place objects, class instances (and class assignments) on
interaction diagrams
■ Relocate components and component packages between
component packages
■ Relocate classes, nested classes, use cases, interfaces, associations
and packages between packages
■ Place activity diagram model elements on an activity diagram
Note: You cannot re-order elements on the browser.

26 Rational Rose 2000, Using Rose


Viewing the Browser

Browser to Browser Capabilities


The following table lists the actions you can perform by dragging-and-
dropping objects within the browser:

Table 2 Browser to Browser Capabilities

Capability Description

Add ■ Class to class diagram


■ Logical package to class diagram
■ Component to component diagram
■ Component package to component
diagram

Assign ■ Component to class and interface


■ Class and interface to component
■ Logical package to component package

Move ■ Class diagram to logical package


■ Interaction diagram to logical package
■ Collaboration diagram to logical
package
■ Component diagram to component
package
■ State/Activity model to the logical or
use-case view
■ Process to processor
■ Operation to class and interface
Move/Copy*
■ Class attribute to class and interface

Relocate ■ Class and interface to logical package


■ Class to nested class
■ Logical package to logical package
■ Component to component package
■ Component package to component
package
■ Use case to package

Rational Rose 2000, Using Rose 27


Chapter 3 The Browser

* The default action is Move. To Copy, hold down the CTRL key while
dragging the element to its destination.

Browser to Diagram Capabilities


The following table lists the actions you can perform by dragging-and-
dropping elements from the browser to diagrams:

Table 3 Browser to Diagram Capabilities

Capability Description

Add ■ Class and interface to class diagram


■ Logical package to class diagram
■ Component to component diagram
■ Component package to component
diagram
■ Processor to deployment diagram
■ Device to deployment diagram

Assign ■ Component to class and interface


■ Class and interface to component
■ Component package to package
■ Logical package to component
package

Move/Copy* ■ Operation to class and interface


■ Class attribute to class and interface

Relocate ■ Class to logical package


■ Logical package to logical package
■ Component to component package
■ Component package to component
package

Create Object ■ Class in interaction diagram


■ Class in collaboration diagram

* The default action is Move. To Copy, hold down the CTRL key while
dragging the element to its destination.

28 Rational Rose 2000, Using Rose


Viewing the Browser

Browser to Specification Capabilities


The following table lists the actions you can perform by dragging and
dropping model elements from the browser to a specification:
Table 4 Browser to Specification Capabilities

Capability Description

Assign ■ Class and interface to/from


Component Specification Realizes tab
■ Component to Class Specification
Components tab

Move/Copy ■ Operations to/from Class Specification


Operations tab
■ Attributes to/from Class Specification
Attribute tab

Rational Rose 2000, Using Rose 29


Chapter 4

Introduction to Diagrams

Overview
Diagrams are views of the information contained in a model. Rational
Rose automatically maintains consistency between the diagram and
their specifications. You can change properties or relationships by
editing the specification or modifying the icon on the diagram. The
associated diagrams or specifications are automatically updated.

Diagram Windows
In a diagram window, you can create and modify graphical views of the
model. Rational Rose supports the following kinds of diagrams:
■ Class Diagram
■ Use-Case Diagram
■ Collaboration Diagram
■ Sequence Diagram
■ Component Diagram
■ Statechart Diagram
■ Deployment Diagram
■ Activity Diagram
Each icon on a diagram represents an element in the model. Since
diagrams illustrate multiple views of a model, each model element can
appear in none, one, or several of a model’s diagrams. You can control
which elements and properties appear on each diagram.

Rational Rose 2000, Using Rose 31


Chapter 4 Introduction to Diagrams

To create or add icons to a diagram, click Tools > Create and click one of
the model elements. Click on the diagram to place the element.

Viewing Diagrams
When a diagram is opened, it is displayed in a window within the
application window. This diagram window has its own control-menu
box, title bar, minimize button, and maximize button. Each diagram
window also has vertical and horizontal scroll bars for panning across
diagrams larger than the window. The application window presents a
toolbox that contains tools appropriate for the current diagram.

Vertical Scroll Bar


Toolbox

Horizontal Scroll
Bar

Figure 6 Diagram Window

You can resize a diagram window by using the left mouse button to
drag a side or corner of the diagram’s border. You can reduce a diagram
to an icon by clicking on its minimize button.

32 Rational Rose 2000, Using Rose


Diagram Windows

Displaying Multiple Diagrams


You can display multiple diagrams simultaneously in the application
window.

Figure 7 Multiple Diagrams Cascade Windows

The shaded title bar indicates that it is the current diagram. Diagram-
specific commands apply to the current diagram and the application
window displays the toolbox associated with the current diagram.
Menu commands and toolbox icons not appropriate for the current
diagram are “dimmed” and cannot be used. You can make a diagram
“current” by clicking on it.

Rational Rose 2000, Using Rose 33


Chapter 4 Introduction to Diagrams

To display multiple diagrams in cascaded windows, as shown in


Figure 7, or as tiled windows in Figure 8, click Window > Cascade or Tile.

Figure 8 Multiple Diagrams Tiled Windows

Creating, Linking, Displaying, Renaming, and Deleting


Diagrams

Create a New Diagram


1. On the Browse menu, click xxx Diagram, where xxx is the diagram
type. (If you select Deployment Diagram, the diagram is immediately
displayed and the following steps can be ignored.)
2. In the resulting dialog box, select a view from the list on the left.
3. Click <New> from the list on the right. (If you are creating a new
interaction diagram, you must click either Sequence or Collaboration
from the New Interaction dialog box.)
4. Click OK.
5. Type the diagram title. If you do not enter a title, the diagram is
labeled untitled.
6. Click OK.

34 Rational Rose 2000, Using Rose


Creating, Linking, Displaying, Renaming, and Deleting Diagrams

Link a Diagram
You can link one diagram to another diagram through the note icon.
This feature works somewhat like the shortcut method you may be
familiar with in the Windows operating environment. Once the diagram
is linked, you can double-click on the note and the linked diagram is
immediately displayed. A linked diagram is indicated by underlined
text in the note.
1. Create a note on any diagram.
2. Display the browser if not already visible.
3. In the browser, locate the diagram that you want to link.
4. Drag the diagram icon from the browser onto the note icon on the
diagram.
❑ As you position the cursor onto the note, you will see the
shortcut symbol (a dotted square and a curved arrow inside a
solid square).
5. The fully qualified name is displayed in an underline font.
Note: You may need to resize the note to see the entire name.
6. Change the text in the note (if desired) to something more
meaningful to your project.
7. Double-click on the note to immediately view the linked diagram.

Display a Diagram
1. On the Browse menu, click xxx Diagram, where xxx is the diagram type.
(If you select Deployment Diagram the diagram is immediately
displayed and the following steps can be ignored.)
2. In the resulting dialog box, select an element from the list on the
left.
3. Select a diagram from the list on the right.
4. Click OK.

Rational Rose 2000, Using Rose 35


Chapter 4 Introduction to Diagrams

Rename a Diagram
1. On the Browse menu, click xxx Diagram, where xxx is the diagram type.
(Note: you cannot rename a deployment diagram.)
2. In the resulting dialog box, select the package containing the
diagram from the list on the left.
3. Select the diagram from the list on the right.
4. Click Rename.
5. Type a new diagram title.
6. Click OK.

Delete a Diagram
1. Click Browse > xxx Diagram, where xxx is the diagram type.
2. In the resulting dialog box, select the package containing the
diagram from the list on the left.
3. Select the diagram from the list on the right.
4. Click Delete.
5. Click Yes on the confirmation box.

Selecting Multiple Elements in the Diagram


You can select multiple elements in the diagram by using the following
steps:
1. Select an elements in a diagram.
2. Hold down the CTRL key.
3. Click each element in the diagram that you want to select. Notice
the squares on each corner of the elements that indicate a selected
element.

36 Rational Rose 2000, Using Rose


Creating and Naming Model Elements

The diagram example below shows multiple elements selected in a


diagram:

Figure 9 Selected Elements in a Diagram

Note: You can select any element in the diagram.

Creating and Naming Model Elements

Create an Element on the Diagram


1. Click on the appropriate creation tool.
2. Click on a location in the diagram.
Rational Rose creates a model element of the appropriate kind and
places an icon representing this element on the diagram and in the
browser.

Create an Element in the Browser


1. Click on the appropriate package.
2. From the shortcut menu, click New then point to the element you
want to create.
The element exists only in the browser until you drag it on a diagram.

Naming Model Elements


You can name your model elements with any combination of
characters that are meaningful to you. Depending on the model
element and its location, you may or may not be restricted to unique
names.

Rational Rose 2000, Using Rose 37


Chapter 4 Introduction to Diagrams

For example, actors, use cases, classes, components, and packages


that reside in different packages do not require unique names. When
different elements have the same name, the elements are said to be
“overloaded.”
Overloading gives you the flexibility of using existing software libraries
that may have the exact names you have in your code or in another
software library.
Overloading also allows you to do multi-lingual component based
development. For example, an application can be modeled even if the
GUI for screen input is in VB or Java, the processing is in C++, and the
database in Oracle. In this example, each application can have their
own definition of a class “Customer” where Customer does different
things.
Another useful feature of overloading is the ability to have actors in the
use-case view and classes in the logical view with the same name.
When naming an element, it is important to note that in some cases an
overloaded element is created, while in other cases, the existing
element with the same name is used (and therefore an overloaded
element is not created).

Naming an Element on the Diagram


1. Create a new element on the diagram from the toolbox.
2. Type in a name. As soon as you start typing, a pop-up box listing
all the available class names in the model is displayed.
You can select one of the highlighted names by double-clicking or
by pressing the ENTER or TAB key. Alternatively you can continue
typing (and click outside the edit area) to enter a new name.
❑ If you do not want to see this window, you can turn this option
off. To do so, click Tools > Options. Click on the Diagram tab. Under
the Miscellaneous section on the lower left, click Class Name
Completion to turn the feature off.
If the name you select is an overloaded name, clicking outside the
box displays a secondary window, asking you to select the name
from the fully qualified path.

38 Rational Rose 2000, Using Rose


Creating and Naming Model Elements

Creating/Naming an Overloaded Element on the Diagram


If you want to create an overloaded element name on the diagram, you
must enter the name through the specification. If you instead enter the
duplicate name on the element in the diagram, you will be using an
existing element rather than creating a new one with its own
characteristics.
1. Create a new element on the diagram from the toolbox.
2. Double-click on the element or click Browse > Specification, to display
the specification.
3. Type a name in the name field.
4. Click OK.
If this name already exists in another package, a warning dialog is
displayed telling you the name of the element and type already
exists in anther package. For example: “Class AA now exists in
multiple name spaces.”
You can dismiss this box either by clicking Cancel which ignores the
name or OK. If you do not want to see the dialog box anymore,
select “Don’t warn anymore this session” button. If you want to
start seeing the warnings again, you must restart the application.
The element is now named with a duplicate name, but has its own
unique characteristics.

Placing an Overloaded Element on the Diagram from the


Browser
From the browser, drag the element onto the diagram.
If the element belongs to a parent different from the diagram, and Show
Visibility is on, the element is annotated with the term ‘(from x)’ where x
is the element’s location. If Show Visibility is off, only the element name is
displayed.

Rational Rose 2000, Using Rose 39


Chapter 4 Introduction to Diagrams

Fully Qualified Names


A fully qualified name is displayed as you place your pointer over the
model element. A fully qualified name consists of the element hierachy
(starting at the package level), where each level is separated by double
colons.
Example: Logical View::Package B::Class 1

Renaming Model Elements


1. Click on the name of a selected icon to display a flashing vertical
bar that designates the insertion point.
2. Backspace and type additional text.
3. Note that stereotypes in the form <<stereotype>> are extracted
from the name of an item when you edit it.
4. Click outside the named icon.
Alternatively, you can double-click on an icon to display its
specification; modify the Name field and click OK.
If double-clicking on a logical package icon displays the main class
diagram, click Tools > Options and click the Diagram tab. Click on the
Double-Click to Diagram check box to turn off this option. With this option
turned off, double-clicking on a package will display the specification.

Reassigning Model Elements


This feature allows you to make a selected icon represent a different
model element.
1. Select the icon to reassign.
2. Click Edit > Reassign.
The dialog box lists the packages in the model on the left and a list of
the valid elements to choose from on the right. Choose the model
element which the selected icon will represent. This operation affects
only the selected icon; other icons representing the original model
element—on the current diagram and all other diagrams—maintain
their original representation. Model elements involved in the operation
of this command are themselves unchanged.

40 Rational Rose 2000, Using Rose


Manipulating Icons

Manipulating Icons
Manipulating icons include selecting, deselecting, moving and resizing.
These features are similar to those you might find in most major
drawing tools.

Selecting Icons (Option 1):

■ To select a single icon, left-click on the icon to be selected. Rational


Rose displays the icon’s selection handles, and deselects all other
icons.
■ To select several icons, hold the CONTROL or SHIFT key down and
click on each icon to be selected.

Selecting Icons (Option 2):

1. Point near the border of one of the icons to be selected.


2. Left-drag to create a dashed selection box around the icons you
want to select.
3. Release the left mouse button.
Rational Rose displays each icon’s selection handles, and deselects all
other icons.

Deselecting Icons:

■ To deselect all icons, click in any open area of the diagram.


■ To deselect a specific icon:
1. Depress and hold the CONTROL or SHIFT key.
2. Click on the icon.
Any other icons that were previously selected remain selected.

To resize an icon:

1. Click on the icon to be resized.


2. Choose the appropriate selection handle and left-drag to the new
dimension.
Rational Rose redraws the icon at the new size, preserving its
proportions. To change the proportions of an icon, depress the CTRL
key while resizing it.

Rational Rose 2000, Using Rose 41


Chapter 4 Introduction to Diagrams

To move one or more icons (Option 1):

1. Select the icon(s).


2. Left-drag to the desired location.
3. Release the left mouse button.

To move one or more icons (Option 2):

1. Select the icon(s).


2. Use the four directional arrow keys to move the icons by one pixel
in the indicated direction, or depress the CTRL key while using the
arrow keys to move eight pixels in the indicated direction.
If the snap-to-grid operation is enabled, icons and text boxes that are
created or moved will be aligned with the nearest grid coordinate. To
enable or disable this operation, in the Options dialog box, click Snap To
Grid. To specify the size of the grid in pixels, on the Options dialog box,
click Grid Size.
To change from one kind of element or relationship to another:
1. Click on the toolbox tool bearing the desired icon.
2. Depress and hold the ALT or META key.
3. Click on the icon to be changed.
Rational Rose redraws the icon and updates the model to reflect the
change, or reports an error if the change is not legal.

Deleting, Cutting, Copying, and Pasting Icons


You can delete cut, copy, and paste icons between different diagram
windows using commands on the Edit menu or the tools on the toolbar.

Delete

Rational Rose has two distinct delete functions. Use:


■ Delete to remove the selected icon from the current diagram with no
change to the model element it represents.
■ Delete from Model to remove the represented element from the model,
along with any icon representing it on any diagram.
On the Edit menu, clicking Cut performs a delete operation on some
diagrams and a delete from model operation on others.

42 Rational Rose 2000, Using Rose


Correlations

Cut, Copy, and Paste

Clicking Cut, Copy, or Paste can manipulate selections containing icons


and text in diagrams, and text information in specification fields.
Clicking Copy will copy the selected icons to the platform clipboard.
Clicking Cut performs this same operation and then performs a delete
operation. You can use these commands to move some or all of a class
diagram to other tools that support the platform clipboard.
Clicking Paste in a class diagram adds icons from the clipboard to the
center of the current diagram as if you manually created them with the
toolbox.

Other Menu Commands

On the Edit menu, clicking Undo reverses the last Delete, Delete From Model,
or Cut.
The Edit menu also provides commands that enable you to Select All, Find,
and Rename icons.
The Browse menu provides commands to navigate among diagrams, and
create, rename, and delete them.
When you click the right mouse button on an icon, Rational Rose
displays a shortcut menu. This modifies properties (for icons that
represent relationships) or selects properties to be displayed within the
icon.

Correlations
Depending on the diagram selected, a correlation can be a relationship,
a link, a dependency, a transition or a connection. The word correlation
can stand for any of the items previously listed.

Creating Correlations Between Elements

To place a correlation between two or more icons:

1. Click on the relationship’s tool in the toolbox.


2. Point to the client icon on the diagram.
3. Depress and hold the left mouse button.

Rational Rose 2000, Using Rose 43


Chapter 4 Introduction to Diagrams

4. Drag the pointer to the supplier icon on the diagram.


❑ You can create vertices while placing the relation, by releasing
the mouse button while still on the diagram. A new vertex is
created each time you lift the mouse button.
❑ You can modify a vertex by dragging on a selected vertex.
❑ Joining an inherits relationship to another inherits relationship
will create a tree, rather than a hierarchical structure.
5. Release the mouse button at the supplier element.
Rational Rose inserts and selects the relationship, deselecting any
other icons. Moving the relationship or class element(s) automatically
adjusts the size or vertices as necessary.

To bend a correlation icon:

1. Point to the section of the icon to introduce or modify a bend.


2. Left-drag the pointer to the new location for that section of the
icon.
3. Release the mouse button.
When you release the mouse button, Rational Rose redraws the
correlation icon with the new or modified bend. If the modification
nearly eliminates a bend, Rational Rose will replace the bend with a
straight segment.

To reconnect a correlation icon from one icon to another:

1. Point to the end you want to reconnect.


2. Left-drag to the new icon.
3. Release the left mouse button.
Rational Rose redraws the relationship between the two icons and
updates the model to reflect the change, or reports an error if the
change is not legal.

To name a newly-created correlation:

1. Click on the icon.


2. Type the name.
3. Click outside the named icon.

44 Rational Rose 2000, Using Rose


Adorning the Diagrams

To change the name of a correlation:

1. Click on the name to display a flashing vertical bar that designates


the insertion point.
2. Backspace and type additional text.
3. Click outside the named icon.
Alternatively, you can change the name in the Name field of the
specification.

Adorning the Diagrams


You can select which adornments (symbols) to display on the diagram
through the shortcut menu. The shortcut menu is displayed by
clicking the right mouse button on an icon. You can click on the menu
choices to enable and disable them; a check mark indicates that a
choice is enabled. You can also adorn your diagram with annotation
that you add. This annotation or adornment is typically used as notes
to yourself or others about specification features or functions not noted
by Rational Rose.

Manipulating Text
To place text in a diagram:
1. To select non-default font parameters, on the Options dialog box,
click Font or Font Size.
2. Choose the tool bearing ABC from the toolbox.
3. Click on the location in the diagram.
To change the default font parameters:
1. Ensure that nothing is selected by clicking on an empty region of
any diagram.
2. To select the desired default font parameters, on the Options dialog
box, click Font or Font Size.
The default font parameters apply to all diagrams.
To change the dimensions of the invisible box containing text in a
diagram:
1. Click on the text to make the text box’s selection handles visible.
2. Left-drag the appropriate selection handle to resize the text box.

Rational Rose 2000, Using Rose 45


Chapter 4 Introduction to Diagrams

To move the invisible box containing text in a diagram:


(Option 1):
1. Click on the text.
2. Left-drag the text to the location.
3. Release the left mouse button.
To move the invisible box containing text in a diagram:
(Option 2):
1. Click on the text.
2. Use the four directional arrow keys to move the text box by one
pixel in the indicated direction, or depress the CTRL key while
using the arrow keys to move eight pixels in the indicated
direction.

46 Rational Rose 2000, Using Rose


Chapter 5

Introduction to Specifications

A specification enables you to display and modify the properties and


relationships of a model element, such as a class, a relationship, or an
operation.
Some of the information displayed in a specification can also be
displayed inside icons representing the model element in diagrams.
The specification fields are standard interface elements such as text
boxes, list boxes, option buttons, and check boxes.

Displaying Specifications
You can display a specification in the following ways:
■ Double-click on an item in a diagram or browser.
■ Click a diagram item and then click Browse > Specification.
■ Click Open Specification from the shortcut menu.
■ Select the diagram item and press CTRL+B on the keyboard.
Rational Rose displays a specification that corresponds to the selected
item.
In order to view a specification when you double-click on a logical or
component package, you must turn off the Double-Click to Diagram option.
To disable this option, click Tools > Options. Go to the Diagram tab. A check
mark inside the Double-Click to diagram check box indicates the main
diagram will be displayed when you double-click. If there is no check
mark in the check box, double-clicking on a logical or component
package displays the package specification.

Rational Rose 2000, Using Rose 47


Chapter 5 Introduction to Specifications

Custom Specifications
When you open the specification of an element that has an assigned
language, a custom specification will be displayed if supported. If not
supported, the standard Rose specification will be displayed.
The following specifications can be customized by language add-ins:
■ Association
■ Class
■ Class Attribute
■ Generalize
■ Key/Qualifier
■ Parameter
■ Operation
■ Component
■ Class Instance

Editing Specifications
If you change a model element’s properties or relationships by editing
its specification or modifying the icons on the diagram, Rational Rose
will automatically update the corresponding diagrams or
specifications.
If a model element is write-protected, or contained by a controlled unit
that is write-protected, the OK button on the specification will be
disabled to prevent the element from being modified.
Specifications can be resized by placing the pointer on a specification
corner. Click and drag the specification to the desired size.
Specifications can also be printed by clicking File > Print.

48 Rational Rose 2000, Using Rose


Common Specification Elements

Common Specification Elements


The specifications share a number of common elements which are
discussed on the following pages. For details on specific specifications
and their unique elements, refer to the following chapters.

Dialog Boxes
All specifications are presented in a dialog box format and contain tabs
for navigating to specific pages or items. You can resize all
specifications.

General Tab
The first tab presented in all specifications is labeled General and
usually contains information such as Name and Documentation.

Figure 10 General Tab

Rational Rose 2000, Using Rose 49


Chapter 5 Introduction to Specifications

Name

Every model element and each relationship can be labeled with a word
or phrase that denotes the semantics or purpose of the relationship.
You can enter the name in the diagram or in the Name field of a
specification.
■ If you enter the name in the diagram, Rational Rose displays the
entry in the Name field.
■ If you enter the name in the specification, Rational Rose displays
the new name in the icon and updates the information in the
model.
You can rename an element using one of the following methods:
■ Change its name in the diagram or browser.
■ Change its name in the specification.

Documentation

Use the Documentation field to describe relationships. The description can


include such information as the roles, keys, constraints, purpose, and
essential behavior of the element. You can enter information in the
documentation field in one of two ways:
■ Enter text directly in the free form text field.
■ Click View > Documentation.
Rational Rose does not display this field in the diagram.
Note: If you document a class and identify the concepts or functions
represented by the entity, you can use the field to form a basis of a more
traditional data dictionary. You can also list the statements of obligation
to provide certain behavior with the class. You can use this entry as a
place holder for the responsibilities of the class that you will determine
during development.

50 Rational Rose 2000, Using Rose


Common Specification Elements

Detail Tab
Another common tab is the Detail tab. The Detail tab contains
information specific to the model element you have selected. The Detail
tabs and their relationship to a diagram element are described in their
respective chapters.

Figure 11 Detail Tab

Files Tab
The Files tab allows you to insert new files or URLs or view files and
URLs already inserted or attached to your model element or diagram.
The Files tab is useful for maintaining links to supplemental
documentation about the system being built (for example, Vision
Documents, GUI sketches, project plans, etc.).
Any attached URLs or files listed here are also displayed when the
element or diagram is expanded in the browser.

Rational Rose 2000, Using Rose 51


Chapter 5 Introduction to Specifications

Figure 12 Files Tab

Viewing Existing Files or URLs

If a file is already inserted, the Filename and Path are displayed on the
tab. To open the document or go the web site, double-click on either
the Filename or Path, or choose Open File/URL from the shortcut menu.

Inserting New Files

You can insert (or attach) files by:


■ Using the drag-and-drop technique.
■ Clicking Insert File from the shortcut menu and navigating through
the dialog box to locate your file.

52 Rational Rose 2000, Using Rose


Common Specification Elements

Inserting New URLs

Click Insert URL from the shortcut menu; this will insert the default
address www.rational.com. Edit the Filename and Path to point to the
correct web site.

Tab Buttons
The bottom of each tab, regardless of type (General, Detail, etc.),
contains five buttons to control the actions on each tab.

Figure 13 Tab Buttons

OK

Clicking OK applies the changes made to the specification and closes


the dialog box, returning focus to the diagram.

Cancel

Clicking Cancel ignores all changes made to the specification since the
last Apply, closes the dialog box, and returns focus to the diagram.

Apply

Clicking Apply enacts the changes made to the specification while


leaving the specification open.
Changes to a Specification field are not enacted until you click on the
specification’s OK or Apply. These will be disabled if the model element
is assigned to a controlled unit which is write-protected.

Browse

Clicking Browse displays four choices:


■ Select in Browser which highlights the selected item in the browser.
■ Browse Parent which opens the specification for the parent of the
selected item.
■ Browse Selection which opens the specification for the currently
selected item.

Rational Rose 2000, Using Rose 53


Chapter 5 Introduction to Specifications

■ Show Usage which displays a list of all diagrams in which the


currently selected element is the supplier, or in the case of a
collaboration diagram, a list which shows the usage of a message.

Help

Clicking Help invokes the online help topic related to the dialog box.

Navigating the Tabs


Many tabs contain lists of elements related to the specification and are
described in detail in their respective chapters. However, the methods
used to navigate through the specifications are very similar throughout
all tabs.
The lists typically consist of one row per related element. The rows are
typically divided into columns, describing aspects of the rows (e.g.
Filename and Path on the Files tab). To navigate between rows and
columns in the list, either select the row and column with the pointer
or use the arrow keys on the keyboard.

Adding and Deleting Entries


To insert a new row in a list, click Insert from the shortcut menu or press
the INSERT key. An untitled entry is added.
To delete a row, select the row and click Delete from the shortcut menu
or press the DELETE key.

Editing Entries
To edit a column in a row, select the column and press F8 or select the
column twice with the pointer. Enter text into the column or select an
entry from the drop-down menu (if available). After the column has
been edited, either accept the change (by clicking outside the column,
pressing the ENTER or TAB key) or cancel the addition (by pressing the
ESC key).

54 Rational Rose 2000, Using Rose


Navigating the Tabs

To open the specification for an element displayed in a list, select the


row and column and click Specification from the shortcut menu or
double-click on the column. For example, double-clicking on the Name
column in the Relations tab of the class specification will open the
specification for the relation, while double-clicking on the End Class
column in the same list will open the specification of the related class.
To reorder the rows in a list, select the row to be moved and drag it to
the new location in the list. It is not possible to reorder rows in every
list tab. To move an element in a list to another specification, the
browser, or to an open diagram, select the row and drag it to the new
location.

Rational Rose 2000, Using Rose 55


Chapter 6

Class Diagrams and Specifications

Class Diagram Overview


A class diagram is a picture for describing generic descriptions of
possible systems. Class diagrams and collaboration diagrams are
alternate representations of object models. Class diagrams contain
classes and object diagrams contain objects, but it is possible to mix
classes and objects when dealing with various kinds of metadata, so
the separation is not rigid.

Rational Rose 2000, Using Rose 57


Chapter 6 Class Diagrams and Specifications

Class diagrams are more prevalent than object diagrams. Normally you
will build class diagrams plus occasional object diagrams illustrating
complicated data structures or message-passing structures.

Figure 14 Class Diagram Example

Class diagrams contain icons representing classes, interfaces, and


their relationships. You can create one or more class diagrams to
depict the classes at the top level of the current model; such class
diagrams are themselves contained by the top level of the current
model. You can also create one or more class diagrams to depict classes
contained by each package in your model; such class diagrams are
themselves contained by the package enclosing the classes they depict;
the icons representing logical packages and classes in class diagrams.
You can change properties or relationships by editing the specification
or modifying the icon on the diagram. The associated diagrams or
specifications are automatically updated.

58 Rational Rose 2000, Using Rose


Class Diagram Overview

Creating and Displaying a Class Diagram


You can create or display a class diagram in one of three ways:
■ Click Browse > Class Diagram.
■ On the toolbar, click the class diagram icon.
■ On the browser, double-click on the class diagram icon.

Class Diagram Toolbox


The graphic below shows all the tools that can be placed on the class
diagram toolbox. See “Customizing the Toolbox” on page 14 for more
information on adding or deleting tools on a diagram toolbox.
The application window displays the following toolbox when the
current window contains a class diagram, you have selected View > As
Unified, and you have customized the toolbox to display all the tool options.

Selector Text

Note Note Anchor

Class Interface
Unidirectional Unidirectional
Association Aggregation
Package
Link Attribute
Generalization
Dependency
Realizes Relationship Parameterized Class
Class Utility Parameterized Class Utility
Association
Aggregation
Actor
Use Case
Instantiated
Class Instantiated Class Utility
Lock

Figure 15 Class Diagram Toolbox

Rational Rose 2000, Using Rose 59


Chapter 6 Class Diagrams and Specifications

Assigning a Class to Another Logical Package


Every class is assigned to a logical package. When you create a class
using a creation tool from the class diagram toolbox, the class is
assigned to the logical package containing the class diagram. In
Figure 14, “Class Diagram Example,” on page 58 the class diagram
named Main is directly contained by the logical package named
LinkManager. All of the classes depicted on Main are assigned to
LinkManager, except the class SafeStorage. This is assigned to logical
package StorageManagement. Rational Rose annotates the icon
representing SafeStorage with the phrase from Storage Management.
To re-assign a class from one logical package to another:
1. Select an icon (or icons) representing the class in a diagram
contained by the logical package to which the class should be
assigned. (You might need to create such a diagram or icon if one
does not currently exist.)
2. Click Edit > Relocate.
Rational Rose will update all class diagrams to reflect the new
assignment.
Like classes, logical packages are also assigned to logical packages—
permitting nesting to an arbitrary depth. Assigning and re-assigning
can be applied to logical packages and classes.

Adding and Hiding Classes, and Filtering Class Relationships


The commands on the Query menu provide powerful facilities for
controlling which model elements are represented by icons in the
current diagram.
On the Query menu, clicking:
■ Add Classes adds classes to the diagram by name.
■ Add Use Cases adds use cases to the diagram by name.
■ Expand Selected Elements adds classes to the diagram based on their
relationships to selected classes.
■ Hide Selected Elements removes selected classes from the diagram and
optionally removes their clients or suppliers from the diagram.
■ Filter Relationships controls which kinds of relationships appear in the
current diagram.

60 Rational Rose 2000, Using Rose


Class Specification

Class Specification
A Class Specification displays and modifies class properties and
relationships. Some of the information in the specification can also be
displayed inside class icons.
If a field does not apply to a particular class type, the field is
unavailable and you cannot add or change information in the field.
To display a Class Specification, click an icon representing the class in a
class diagram and click Browse > Specification.
If you have not gone clicked Tools > Options and clicked Double-Click to
Diagram, you can double-click on any icon representing the class. You
can also click Specification from the shortcut menu.

Specification Content

The Class Specification consists of the following tabs: General, Detail,


Operations, Attributes, Relations, Component, Nested, and Files.

Rational Rose 2000, Using Rose 61


Chapter 6 Class Diagrams and Specifications

Class Specification—General Tab

Figure 16 Class Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Type
Your Type choices include: Class, Parameterized Class, Instantaited
Class, Class Utility, Parameterized Class Utility, Instantiated Class
Utility, and Metaclass.

Parent
The parent the class belongs to (its package) is displayed in this static
field.

62 Rational Rose 2000, Using Rose


Class Specification

Stereotype
A stereotype represents the subclassification of an element. It
represents a class within the UML metamodel itself, that is, a type of
modeling element. Some stereotypes are already predefined, but you
can also define your own to add new kinds of modeling types.
Stereotypes can be shown in the browser and on diagrams. The name
of the stereotype may appear in angle brackets <<>>, depending on the
settings found in either the Diagram or Browser tabs of the Options dialog
box located under the Tools menu. Refer to the Stereotype chapter for
more information on stereotypes.
To show stereotypes on the diagrams, click Options from the shortcut
menu and click Stereotype Name or Stereotype Icon. Stereotype Name displays
the name in angle brackets (ie. <<stereotype>>). Stereotype Icon displays
the graphical representation.

Export Control
The Export Control field specifies how a class and its elements are viewed
outside of the defined package.
Table 5 Export Control Field Options

Select: To Indicate:

Public The element is visible outside of the enclosing


package and you can import it to other
portions of your model. Operations are
accessible to all clients.

Protected The element is accessible only to subclasses,


friends, or the class itself.

Private The element is accessible only to its friends or


to the class itself.

Implementation The element is visible only in the package in


which it is defined. An operation is part of the
implementation of the class.

The Export Control field can be set only in the specification. No special
annotation is related to access control properties.

Rational Rose 2000, Using Rose 63


Chapter 6 Class Diagrams and Specifications

To change the export control type for the class, click on the appropriate
option in the Export Control field. You can display the implementation
export control in the component compartment. You can display
visibility in an icon through the shortcut menu.

Class Specification—Detail Tab

Figure 17 Class Specification Detail Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
element not covered in the following section.

64 Rational Rose 2000, Using Rose


Class Specification

Cardinality
The Cardinality field specifies the number of expected instances of the
class. In the case of relationships, this field indicates the number of
links between each instance of the client class and the instance of the
supplier. You can set a specific cardinality value for the client class,
supplier class, or both.
Use the following syntax to express cardinality:
Table 6 Cardinality Field Options

Type Description

n (default) Unlimited number of instances

1 One instance only

0..n Zero or more instances

1..n One or more instances

0..1 Zero or one instance

<literal>* Exact number of instances

<literal>..n Exact number or more instances

<literal>..<literal> Specified range of instances

<literal>..<literal>,<literal> The number of instances will be


in the specified range or an
exact number of instances

<literal>..<literal>, The number of instances will be


<literal>..<literal> in one of the specified ranges

*Where <literal> is any integer greater or equal to one.

To display class cardinality on an icon, right-click on the icon and


select a cardinality through the shortcut menu. A literal value can only
be specified on the specification.

Space
Use the Space field to document the amount of storage required by
objects of the class during execution.

Rational Rose 2000, Using Rose 65


Chapter 6 Class Diagrams and Specifications

Persistence
Persistence defines the lifetime of the instances of a class. A persistent
element is expected to have a life span beyond that of the program or
one that is shared with other threads of control or other processes. Use
this field to identify the persistence for elements of this class:
Table 7 Persistence Field Options

Type Description

Persistent (Default) The state of the element transcends the lifetime of


the enclosing element.

Transient The state and lifetime of the element are identical.

Static The element exists during the entire execution of a


program.

The persistence of an element must be compatible with the persistence


that you specified for its class. If a class persistence is set to Persistent,
then the object persistence is either persistent, static or transient. If a
class persistence is set to Transient, then the object persistence is either
static or transient.
You can set the persistence only through the specification. This field is
inactive for class utilities, parameterized class utilities, and
instantiated class utilities.
To set the persistence, click on the applicable option in the Persistence
field. You can display the persistence in the diagram by clicking Show
Persistence from the shortcut menu.

66 Rational Rose 2000, Using Rose


Class Specification

Concurrency
A class concurrency defines its semantics in the presence of multiple
threads of control. Choose one of the following options:
Table 8 Class Concurrency Options

Type Description

Sequential (default) The semantics of the operation are


guaranteed only in the presence of a single
thread of control. Only one thread of
control can be executing in the method at
any one time.

Guarded The semantics of the operation are


guaranteed in the presence of multiple
threads of control. A guarded class
requires collaboration among client
threads to achieve mutual exclusion.

Active The class has its own tread of control.

Synchronous The semantics of the operation are


guaranteed in the presence of multiple
threads of control; mutual exclusion is
supplied by the class.

Abstract
The Abstract check box identifies a class that serves as a base class. An
abstract class defines operations and states that will be inherited by
subclasses. This field corresponds to the abstract class adornment
displayed inside the class icon.
To toggle the abstract adornment, click on its check box.
When you click Abstract, the abstract class adornment is displayed in
the lower left corner of the class icon.
You can change the abstract class adornment only through the
specification.
The Abstract field is inactive for metaclasses, class utilities,
parameterized class utilities, and instantiated class utilities.

Rational Rose 2000, Using Rose 67


Chapter 6 Class Diagrams and Specifications

Formal Arguments
In the Parameterized Class or Parameterized Class Utility Specification, the formal,
generic parameters declared by the class or class utility are listed.
In the Instantiated Class or Instantiated Class Utility Specification, the actual
arguments that match the generic parameters of the class being
instantiated are listed.
You can add, update, or delete parameters only through the Class
Specification. This field applies only to parameterized classes,
parameterized class utilities, instantiated classes, and instantiated
class utilities.
To define the parameters for a class, position the pointer within the
Parameters field and click Insert from the shortcut menu or press the
INSERT key.
Parameters are displayed on class diagrams.

Class Specification—Operations Tab


Operations denote services provided by the class. Operations are
methods for accessing and modifying Class fields or methods that
implement characteristic behaviors of a class.

68 Rational Rose 2000, Using Rose


Class Specification

The Operations tab lists the operations that are members of this class.
Rational Rose stores operation information in an operation
specification. You can access Operation Specifications from the Class
Specification or from the Browser.

Figure 18 Class Specifications Operations Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
element not covered in the following section.
To enter an operation in the Class Specification, use Insert from the
shortcut menu. Rational Rose adds the operation name to the
operations list.

Rational Rose 2000, Using Rose 69


Chapter 6 Class Diagrams and Specifications

The descriptions for each field on the Operations tab are discussed below:
■ Access Control Adornment (Unlabeled):
Public—members of a class are accessible to all clients.
Protected—members of a class are accessible only to
subclasses, friends, or to the class itself.
Private—members of a class are accessible only to the class
itself or to its friends.
Implemented—the class is accessible only by the
implementation of the package containing the class.
■ Stereotype—displays the name of the stereotype.
■ Operation—displays the name of the operation.
■ Return Type—identifies the type of value returned from the operation.
■ Parent—identifies which class defines the operation.
The Operation tab is active for all class types. In the class diagram, you
can display operation names in the class compartment.

Show Inherited
Click this option to see operations inherited from other classes. If there
is no check mark in this field, you can view only operations associated
with the selected class.

70 Rational Rose 2000, Using Rose


Class Specification

Class Specification—Attributes Tab

Figure 19 Class Specification Attributes Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.
The Rational Unified Method asserts that attributes are data values
(string or integer) held by objects in a class. Thus, the Attributes tab lists
attributes defined for the class through the Class Attribute Specification.
You can add an attribute relationship through Insert on the shortcut
menu or by pressing the INSERT key. An untitled entry is added.

Rational Rose 2000, Using Rose 71


Chapter 6 Class Diagrams and Specifications

Attributes and relationships created using this technique are added to


the model, but do not automatically appear in any diagrams.
The descriptions for each field are discussed below:
■ Access Control Adornment (Unlabeled):
Public—members of a class are accessible to all clients.
Protected—members of a class are accessible only to
subclasses, friends, or to the class itself.
Private—members of a class are accessible only to the class
itself or to its friends.
Implemented—the class is accessible only by the
implementation of the package containing the class.
■ Stereotype—displays the name of the stereotype.
■ Name—displays the name of the attribute.
■ Class—identifies where the attribute is defined.
■ Type—this can be a class or a traditional type, such as int.
■ Initial—displays the initial value of an object.
This Attribute tab is active for all class types.

72 Rational Rose 2000, Using Rose


Class Specification

Class Specification—Relations Tab


Classes collaborate with other classes in a variety of ways. The Relations
tab identifies the relationships in which this class is the client (class)
and the corresponding supplier (end) class. If you labeled the
relationship, Rational Rose displays its name after the kind of
relationship.

Figure 20 Class Specification Relations Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification element not covered in the following section.
Rational Rose automatically updates this list when you draw
relationships between classes.

Rational Rose 2000, Using Rose 73


Chapter 6 Class Diagrams and Specifications

The description for each field is discussed below:


■ Name—displays the name of the relationship.
■ Parent—displays the client name.
■ End Class—displays the supplier name.

Class Specification—Component Tab

Figure 21 Class Specification Component Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
element not covered in the following section.

Show All Components

Select this option if you want to get a list of all components in a model.
If this option is not selected, you will see only the components to which
this class is assigned.

74 Rational Rose 2000, Using Rose


Class Specification

Component Name

The component list identifies the components to which this class is


assigned (with a check mark). A class can be assigned to a note or to
several components with the same implementation language assigned.
You can assign the class to a component through Assign on the shortcut
menu, or by dragging a component from the browser and dropping it
in the list.

Package Name

This field displays the package that the component belongs to.

Language

The Language field identifies the implementation language that is


assigned to this element.
Note: When you change the implementation language of a component,
the data types that are used in the specification of operations are
attributes of the assigned classes, are not automatically converted to
data types in the new implementation language. Also if you change the
implementation language for a component with classes that are
assigned to other components, a dialog box is displayed asking how to
handle those classes.

Class Specification—Nested Tab


A nested class is a class that is enclosed within another class. Classes
may contain instances of, inherit from, or use a nested class.
Enclosing classes are referred to as parent classes, and a class that lies
underneath the parent class is called a nested class.
A nested class is typically used to implement functionality for the
parent class. In many designs, a nested class is closely coupled to the
parent class and is often not visible outside of the parent class. For
example:
Τhink of your computer as a parent class and it’s power supply as
a nested class. While the power supply is not visible outside the
computer, the task it completes is crucial for the overall
functionality of the computer.
Note: Nested classes can be cut and pasted.

Rational Rose 2000, Using Rose 75


Chapter 6 Class Diagrams and Specifications

Figure 22 Class Specification Nested Tab

Refer to the description earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

Adding a Nested Class from a Class Specification:

1. Create and name a class.


2. Display the Class Specification.
3. Click on the Nested tab.
4. Right-click to display the shortcut menu, then click Insert.
An untitled class entry is inserted. A nested class entry with a default
class name is inserted.
To display a nested class:
1. Click Query > Add Classes.
2. Select the nested class and place it in the Selected Classes list box.

76 Rational Rose 2000, Using Rose


Class Specification

Deleting a Nested Class from a Class Specification

1. Select the nested class from the Nested tab in the Class Specification.
2. Right-click on the class to display a shortcut menu.
3. From the shortcut menu, click Delete.
Or, use the following steps to delete a nested class:
1. Select the name of the nested class from the Nested Classes list
box in the Class Specification.
2. Press the DELETE key.
If you delete a nested class that is also a parent to other nested classes,
all the nested classes will be deleted.
Note: When you attempt to delete a nested class from a Class
Specification, a warning dialog will appear to verify the deletion.

Relocating Nested Classes from the Browser to a Specification

Classes and Nested Classes can be moved from the browser to the
Class Specification Nested Tab. If you move a class (NewClassA) from
the browser and place it directly on top of a class (NewClassB) on the
Nested tab, NewClassA becomes nested underneath NewClassB.
However, only one level of class nesting appears on the Nested tab. You
can view all levels of nesting in the browser.
For additional information on the browser, refer to Chapter 3, The
Browser.

Moving Nested Classes between Class Specifications

Nested classes can be dragged and dropped between Class


Specification Nested tabs.

Class Specification—Files Tab


Refer to the descriptions in the Introduction to Diagrams and
Specifications chapter if you need information on this tab.

Rational Rose 2000, Using Rose 77


Chapter 6 Class Diagrams and Specifications

Class Attribute Specification


A Class Attribute Specification enables you to display and modify the
properties of a class attribute in the current model.
To display an Attribute Specification, select the entry on the Attribute tab of
the Class Specification and click Insert from the shortcut menu.
Alternatively, double-clicking on the entry will display the Class Attribute
Specification.

Specification Content

The Class Attribute Specification consists of the following tabs: General and
Detail.

Class Attribute—General Tab

Figure 23 Class Attribute General Tab

78 Rational Rose 2000, Using Rose


Class Attribute Specification

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

Class
The class the attribute belongs to is displayed in this static field.

Show Classes
Select the Show Classes check box to list all classes defined in the model
and any fundamental types that reside in the model.
If you clear this check box, the selection lists include only the
fundamental types that reside in the model.

Type
Attribute types can either be classes or language specific types. When
the attribute is a data value, the type is defined as a language specific
type. You can enter the type in the Type field of the Class Attribute
Specification. Rational Rose displays the type beside the attribute name
in the class icon and updates the information in the model.

Initial Value
You can assign an initial value to your class attribute through this
field. Click in the Initial Value field and enter the value.

Rational Rose 2000, Using Rose 79


Chapter 6 Class Diagrams and Specifications

Class Attribute—Detail Tab

Figure 24 Class Attribute Detail Tab

Containment
Physical containment plays a role in the construction and destruction
of an aggregate’s parts through semantics. The specification of physical
containment is necessary for meaningful code generation from the
model.

80 Rational Rose 2000, Using Rose


Class Attribute Specification

You can set one of the following types of physical containment:


Table 9 Physical Containment Options

Type Description

By Value Physical containment of a value of the


part.

By Reference Physical containment of a pointer or


reference to the part.

Unspecified (default) The type of physical containment has


not been specified.

To set or change the containment type in the Relationship Specification,


click on the applicable option in the Containment field. The application
places an adornment at the supplier end of the relationship. You can
also select a value from the shortcut menu.

Static
Select the Static check box to specify that the client class, not the
client’s instances, owns the supplier class. In the case of an attribute,
a static attribute is an attribute whose value is common to a class of
objects rather than a value peculiar to each instance.
You can set this field in the specification or through the shortcut menu.

Derived
The Derived check box indicates whether the element was computed or
implemented directly.
To define a element as derived, select the Derived check box. The
element name is adorned by a “/” in front of the name.

Rational Rose 2000, Using Rose 81


Chapter 6 Class Diagrams and Specifications

Operation Specification
You should complete one Operation Specification for each operation that is
a member of a class and for all free subprograms.
If you change a class operations property by editing its specification,
Rational Rose will update all class diagrams containing icons
representing that class.
To access the Operation Specification, select an entry on the Operation tab of
the Class Specification and double-click the entry or click Insert from the
shortcut menu. You can also bring the specification up through the
shortcut menu.

Specification Content

The Operation Specifications consists of the following tabs: General, Detail,


Preconditions, Semantics, Postconditions, and Files.

82 Rational Rose 2000, Using Rose


Operation Specification

Operation Specification—General Tab

Figure 25 Operations Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

Return Class
For operations that are functions, set this field to identify the class or
type of the function’s result. If show classes is set, the list box displays
all the classes in the package. If Show Classes is not set, only the
predefined set of return class types is displayed.
If you enter a class name and it does not exist in your model, the
application does not create one.

Rational Rose 2000, Using Rose 83


Chapter 6 Class Diagrams and Specifications

Operation Specification—Detail Tab

Figure 26 Operation Specification Detail Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Arguments
This field contains a list of the arguments of the operation. You may
express these arguments in your selected implementation language.
The argument list can be rearranged with the click and drag technique.
Select an argument from the list, drag it to the location, and release.
The list will reflect the new order.

84 Rational Rose 2000, Using Rose


Operation Specification

Protocol
This field lists a set of operations that a client can perform on an object
and the legal orderings in which they might be invoked. The protocol of
an operation has no semantic impact.

Qualifications
This field identifies language-specific features that qualify the method.
You will find this especially useful in Common Lisp Object System
(CLOS), in which methods can be described as before or after.

Exceptions
This field contains a list of the exceptions that can be raised by the
operation. Enter the name of one or more classes identifying the
exception.

Size
This field identifies the relative or absolute amount of storage
consumed by the invocation of the operation.

Time
This field contains a statement about the relative or absolute time
required to complete an operation. Use this field to budget time for the
operation.

Rational Rose 2000, Using Rose 85


Chapter 6 Class Diagrams and Specifications

Concurrency
This field denotes the semantics in the presence of multiple threads of
control. The Concurrency field shows the concurrency for the elements of
a class. The concurrency of an operation should be consistent with its
class.
Table 10 Concurrency Field Options

Type Description

Sequential (default) The semantics of the operation are


guaranteed only in the presence of a single
thread of control. Only one thread of
control can be executing in the method at
any one time.

Guarded The semantics of the operation are


guaranteed in the presence of multiple
threads of control. A guarded class
requires collaboration among client
threads to achieve mutual exclusion.

Synchronous The semantics of the operation are


guaranteed in the presence of multiple
threads of control; mutual exclusion is
supplied by the class.

You can set the concurrency of a class only through the Class
Specification. The Concurrency field is inactive for class utilities,
parameterized class utilities, and instantiated class utilities.
To change the concurrency, click on an applicable option in the
Concurrency field. You can display the concurrency in the class diagram
by clicking Show Concurrency from the shortcut menu.

86 Rational Rose 2000, Using Rose


Operation Specification

Operation Specification—Preconditions Tab

Figure 27 Operation Specification Precondition Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Preconditions
Invariants that are assumed by the operation (the entry behavior of an
operation) are listed.

Interaction Diagram
Select an interaction diagram from the list box that illustrates the
appropriate semantics.

Rational Rose 2000, Using Rose 87


Chapter 6 Class Diagrams and Specifications

Operation Specification—Semantics Tab

Figure 28 Operations Specification Semantics Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Semantics
The action of the operation is shown in this area.

Interaction Diagram
Select an interaction diagram from the list box that illustrates the
appropriate semantics.

88 Rational Rose 2000, Using Rose


Operation Specification

Operation Specification—Postconditions Tab

Figure 29 Operation Specification Postcondition Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Postcondition
Invariants that are satisfied by the operation (the exit behavior of an
operation) are listed in this area.

Interaction Diagram
Select an interaction diagram from the list box that illustrates the
appropriate semantics.

Rational Rose 2000, Using Rose 89


Chapter 6 Class Diagrams and Specifications

Operation Specification—Files Tab


Refer to the descriptions in the Introduction to Diagrams and
Specifications chapter if you need information on this tab.

Parameter Specification
A Parameter Specification enables you to modify an argument of an
operation.

Specification Content

The Parameter Specification consists of the following tab: General.

Defining a New Parameter


To display a Parameter Specification, use the following steps:
1. From a Class Specification’s Operation Tab, double-click an operation to
display the Operation Specification.
2. From the Operation Specification, select the Detail tab.
3. Move the pointer to the arguments section.
4. Right-click to display the shortcut menu.
5. Click Insert, and a new argument is added.
6. Double-click on the argument to display the Parameter Specification.

90 Rational Rose 2000, Using Rose


Parameter Specification

Parameter Specification—General Tab

Figure 30 Parameter Specification General Tab

Refer to the description in the Introduction to Diagrams and


Specification chapter if you need information on the specification
elements not covered in the following section.

Default
The default field may contain a value that an instance takes unless
otherwise specified.

Owner
The operation is the owner of the parameter.

Rational Rose 2000, Using Rose 91


Chapter 6 Class Diagrams and Specifications

Type
Type is a description of a set of instances that share the same
operations, abstract attributes and relationships, and semantics.
Depending upon the language installed, different types will appear.

Association Specification
An association represents a bidirectional semantic relationship
between two classes.
To display the association specification, double-click any icon
representing the processor or click Browse > Specifications.

Specification Content

The Association Specification consists of the following tabs: General, Detail,


Role A and Role B General, and Role A and Role B Detail.

92 Rational Rose 2000, Using Rose


Association Specification

Association Specification—General Tab

Figure 31 Association Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Parent
The parent the component belongs to (its package) is displayed in this
static field.

Stereotype
A stereotype represents the subclassification of an element. It
represents a class within the UML metamodel itself (that is, a type of
modeling element). Some stereotypes are already predefined, but you
can also define your own to add new kinds of modeling types.

Rational Rose 2000, Using Rose 93


Chapter 6 Class Diagrams and Specifications

Role
Use this field to label the role with a name that denotes the purpose or
capacity wherein one class associates with another.
To enter a role name, click in the Role field and enter the text.

Element
The Element field describes the two elements which this association
associates. This field cannot be edited.

Association Specification—Detail Tab

Figure 32 Association Specification Detail Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

94 Rational Rose 2000, Using Rose


Association Specification

Derived
This field indicates whether the element was computed or implemented
directly.
To define an element as derived, select the Derived check box. The
element name is adorned by a “/” in front of the name.

Link Element
This field lists the attributed associations linked to the association.
These attributed associations apply to the association as a whole.

Name Direction
This field defines the direction of a role.

Constraints
The constraint is an expression of some semantic condition that must
be preserved while the system is in a steady state. The constraint on
the Detail tab applies to the association as a whole, while the constraint
on the Detail A or Detail B tab applies to a particular role.
To apply a constraint, click in the Constraint field and enter the text.
Constraints are displayed notationally, surrounded by braces under
the role for which it applies.

Rational Rose 2000, Using Rose 95


Chapter 6 Class Diagrams and Specifications

Association Specification—Role A and B General Tab

Figure 33 Association Specification Role A and B General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
elements shown on this specification.

96 Rational Rose 2000, Using Rose


Association Specification

Association Specification—Role A and B Detail Tab

Figure 34 Association Specification Role A and B Detail Tab

Refer to the descriptions earlier in the chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following sections.

Navigable
The Navigable field indicates in which direction the role is navigating. By
default, roles are bidirectional and no navigation notation is provided.
To set a role’s navigation, click on the Navigable box in the Association
Specification or click Navigable through the shortcut menu. The navigable
arrowhead points in the direction of the role, unless a containment
adornment is displayed. Containment adornments override navigable
adornments.

Rational Rose 2000, Using Rose 97


Chapter 6 Class Diagrams and Specifications

Aggregate
Use the Aggregate field to set a direction to either all or part of the
relationship among instances of these classes. Only one end of the
relationship can be aggregate.
To set the aggregate adornment, click on the Aggregate box in the
Association Specification or click Aggregate through the shortcut menu. The
adornment is a diamond on the relationship.

Static
Use the Static field to specify that the client class, not the client’s
instances, owns the supplier class. In the case of an attribute, a static
attribute is an attribute whose value is common to a class of objects
rather than a value peculiar to each instance.
You can set this field in the specification or through the shortcut menu.
To switch the static adornment in the Relationship Specification, select the
Static check box.

Friend
The friend field designates that the supplier class has granted rights to
a client class to access its non-public parts.
You can set this field in the Relationship Specification or through the
relationship’s shortcut menu.

Containment of
Physical containment has semantics that play a role in the
construction and destruction of an aggregate’s parts. The specification
of physical containment is necessary for meaningful code generation
from the model.

98 Rational Rose 2000, Using Rose


Generalize Specification

You can set one of the following types of physical containment:


Table 11 Containment Field Options

Type Description

By Value Physical containment of a value of the


part.

By Reference Physical containment of a pointer or


reference to the part.

Unspecified (default) The type of physical containment has not


been specified.

You can change the containment type in the Relationship Specification or


you can select a value from the relationship’s shortcut menu.

Keys/Qualifiers
A key or qualifier is an attribute that uniquely identifies a single target
object. The attributes allow 1..n or n..n associations and reduce the
number of instances. The list box will display all keys or qualifiers
currently defined.
To enter a key or qualifier, click Insert from the shortcut menu or press
the INSERT key. An untitled entry is placed in the name and type field.
To change the entry, select to highlight and type in a new name.
For information on the Key/Qualifier specification, refer to the
Key/Qualifier section later in this chapter.

Generalize Specification
A generalize relationship between classes shows that one class shares
the structure or behavior defined in one or more other classes.

Specification Content

The Generalize Specification consists of the following tab: General.

Rational Rose 2000, Using Rose 99


Chapter 6 Class Diagrams and Specifications

Generalize Specification—General Tab

Figure 35 Generalize Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
elements not covered in the following section.

Friendship Required
Select the Frendship required check box to specify the supplier class has
granted rights to the client class to access its non-public members.

Virtual Inheritance
Select the Virtual Inheritance check box to ensure that only one copy of the
base class will be inherited by descendants of the subclasses.

100 Rational Rose 2000, Using Rose


Dependency Specification

Dependency Specification
The dependency relationship indicates that the client class depends on
the supplier class to provide certain services. One class can use
another class in a variety of ways. Typically, a dependency relationship
indicates that the operations of the client invoke operations of the
supplier.

Specification Content

The Dependency Specification consists of the following tab: General.

Dependency Specification—General Tab

Figure 36 Dependency Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
elements shown on this specification.

Rational Rose 2000, Using Rose 101


Chapter 6 Class Diagrams and Specifications

Logical Package Specification


A Logical Package Specification enables you to display and modify the
properties and relationships of a logical package in the current model.
If you change a package’s properties or relationships by editing its
specification, the application will update all class diagrams containing
icons representing that logical package. If you change a logical
package’s properties or relationships by editing a diagram containing
its icon, the application will update the logical package’s specification
and any other diagrams containing its icon.
To display the specification for the Logical View, on the Browse menu, click
Logical View. To display the top level main class diagram, ensure that no
icon is selected, and click Specification from the Browse menu.

Specification Content

The Package Specification consists of the following tab(s): General and Detail.

102 Rational Rose 2000, Using Rose


Logical Package Specification

Package Specification—General Tab

Figure 37 Package Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
elements shown on this specification.

Rational Rose 2000, Using Rose 103


Chapter 6 Class Diagrams and Specifications

Package Specification—Detail Tab

Figure 38 Package Specification Detail Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the elements shown
on this specification.

Global
The Global check box indicates that all public classes in the logical
package can be used by any other logical package.
To switch the global adornment, click on the Global check box. When
you set the global indicator, Rational Rose displays the word “global” in
the lower left corner of the logical package icon.
You can change the global adornment only through the specification.

104 Rational Rose 2000, Using Rose


Has Relationship (Booch Only)

Diagrams
This field lists the diagrams contained in the package. When you add
a diagram to the package, Rational Rose automatically updates this
list.
The Type field is a read-only descriptive text describing the type of
diagram. The Title field is the title of the diagram you entered (and can
be modified).
To add a new diagram, use the shortcut menu and select the
appropriate insert diagram option.
Rational Rose displays the newly-created diagram.

Has Relationship (Booch Only)


A has relationship shows a whole and part relationship between two
classes, where one class is the whole and the other is the part. The
whole class contains or owns its parts. This relationship is also called
an aggregation relationship.
Because attributes for a class can be expressed by a has by-value
relationship with cardinality of “1,” attributes are also defined in the
has relationship specifications.
To display a has relationship’s specification, select any icon
representing the has relationship and either double-click or click
Browse > Specifications.

Specification Content

The Has Specification consists of the following tab(s): General and Detail.

Rational Rose 2000, Using Rose 105


Chapter 6 Class Diagrams and Specifications

Has Specification—General Tab

Figure 39 Has Specification General Tab

Refer to the section on the Class Attribute General Tab earlier in this
chapter for more information.

106 Rational Rose 2000, Using Rose


Has Relationship (Booch Only)

Has Specification—Detail Tab

Figure 40 Has Specification Detail Tab

Refer to the descriptions earlier in this chapter, or in the Introduction


to Diagrams and Specifications chapter if you need information on the
specification elements on this tab.

Rational Rose 2000, Using Rose 107


Chapter 6 Class Diagrams and Specifications

Key/Qualifier Specification
A Key/Qualifier Specification enables you to modify a specific attribute
whose value uniquely identifies a single target object.

Defining a New Key/Qualifier


To display a Key/Qualifier Specification, use the following steps:
1. Double-click on an association or aggregation.
2. From either the Association Specification or the Aggregation Specification,
select the Role A Detail or Role B Detail.
3. Move the cursor to the Key/Qualifier section of either specification.
4. Right-click to display the shortcut menu.
5. Click Insert, and a Key/Qualifier is added.
6. Double-click on the entry to display the Key/Qualifier Specification.

Specification Content

The Key/Qualifier Specification consists of the following tab: General.

108 Rational Rose 2000, Using Rose


Key/Qualifier Specification

Key/Qualifier Specification—General Tab

Figure 41 Key/Qualifier Specification General Tab

Refer to the description in the Introduction to Diagrams and


Specification chapter if you need information on the specification
elements not covered in the following section.

Owner
The owner static field identifies the name, or owner, of the role that the
key/qualifier evolved from.

Rational Rose 2000, Using Rose 109


Chapter 7

Use-Case Diagrams and Specifications

Use-Case Diagram Overview


Use-case diagrams present a high-level view of how a system is used
as seen from an outsider’s (or actor’s) perspective. These diagrams
graphically depict system behavior (also known as use cases). A use-
case diagram may depict all or some of the use cases of a system.
A use-case diagram can contain:
■ Actors (“things” outside the system).
■ Use cases (system boundaries identifying what the system
should do).
■ Interactions or relationships between actors and use cases in the
system including the associations and generalizations.
Use-case diagrams can be used during analysis to capture the system
requirements and understand how the system should work. During
the design phase, use-case diagrams can be used to specify the
behavior of the system as implemented.

Rational Rose 2000, Using Rose 111


Chapter 7 Use-Case Diagrams and Specifications

Actors
Actors represent system users. They help define the system and give a
clear picture of what the system should do. It is important to note that
an actor interacts with, but has no control over the use cases.
An actor is someone or something that:
■ Interacts with or uses (but is not part of) the system.
■ Provides input to and receives information from the system.
■ Is external to the system and has no control over the use cases.
Actors are discovered by examining:
■ Who directly uses the system.
■ Who is responsible for maintaining the system.
■ External hardware used by the system.
■ Other systems that need to interact with the system.
An actor is a stereotype of a class and is depicted as a “stickman” on a
use-case diagram. The name of the actor is displayed below the icon.

Use Case
A use case is a sequence of events (transactions) performed by a
system in response to a trigger initiated by an actor. A use case
contains all the events that can occur between an actor-use case pair,
not necessarily the ones that will occur in any particular scenario.
In its simplest form, a use case can be described as a specific way of
using the system from a user’s (actor’s) perspective. A use case also
illustrates:
■ A pattern of behavior the system exhibits
■ A sequence of related transactions performed by an actor and the
system
Use cases provide a means to:
■ Capture system requirements
■ Communicate with the end users and domain experts
■ Test the system

112 Rational Rose 2000, Using Rose


Use-Case Diagram Overview

Use cases are best discovered by examining what the actor needs and
defining what the actor will be able to do with the system; this helps
ensure that the system will be what the user expects.
Since all the needs of a system typically cannot be covered in one use
case, it is usual to have a collection of use cases. Together this use
case collection specifies all the ways of using the system.
A use case may have a name, although it is typically not a simple name.
It is often written as an informal text description of the actors and the
sequences of events between objects. Use case names often start with
a verb.
The name of the use case is displayed below the icon.

Flow of Events
A flow of events is a sequence of transactions (or events) performed by
the system. They typically contain very detailed information, written in
terms of what the system should do, not how the system accomplishes
the task. Flow of events are created as separate files or documents in
your favorite text editor and then attached or linked to a use case using
the Files tab of a model element. See Chapter 6 for a discussion on the
Files tab.
A flow of events should include:
■ When and how the use case starts and ends.
■ Use case/actor interactions.
■ Data needed by the use case.
■ Normal sequence of events for the use case.
■ Alternate or exceptional flows.

Relationships
Relationships show interactions between actors and use cases.
Association relationships can be drawn from an actor to a use case.
The generalize relationship can be drawn between actors.
These relationships are also presented in a text format on the Relations
tab (described later) for a selected use case or actor.

Rational Rose 2000, Using Rose 113


Chapter 7 Use-Case Diagrams and Specifications

Association
An association provides a pathway for communication between use
cases and actors. Associations are the most general of all relationships
and consequentially, the most semantically weak. If two objects are
usually considered independently, the relationship is an association.
The association name and its stereotype is typically a verb or a verb
phrase and is used to identify the type or purpose of the relationship.
There are two different types of associations connected with use-case
diagrams: uni-directional and bi-directional.
Uni-directional association: By default, associations in use cases are
uni-directional and drawn with a single arrow at one end of the
association. The end with the arrow indicates who or what is receiving
the communication.
Bi-directional association: To change the communication to be bi-
directional, double-click on the association to view the Association
Specification. Select the appropriate Role A (or B) Detail tab, click Navigable
to add a check mark, and click Apply. You have now made the
association bi-directional. The graphic changes from a line with an
arrow at one end to a line with no arrow.
If you prefer, you can also customize the toolbox to include the bi-
directional tool to the use-case toolbox. See Customizing the Toolbox
topic on page 14 for information on adding or deleting tools on a
diagram toolbox.
You can create or display a use-case diagram in one of three ways:
■ Click Browse > Use Case Diagram.
■ On the toolbar, double-click the use-case diagram icon.
■ In the browser, double-click the use-case diagram icon.

114 Rational Rose 2000, Using Rose


Use-Case Specification

Use-Case Diagram Toolbox


The graphic below shows all the tools that can be placed on the use-
case diagram toolbox. See Customizing the Toolbox topic on page 14 for
information on adding or deleting diagram toolbox tools.
The application window displays the following toolbox when the
current window contains a use-case diagram and As Unified is selected
from the View menu.
Note: Some icons will be different if As Booch or As OMT is selected from
the View menu.

Selector Text

Note Note Anchor

Class Interface
Unidirectional Unidirectional
Association Aggregation
Package
Link Attribute
Generalization
Dependency
Realizes Relationship Parameterized Class
Class Utility Parameterized Class Utility
Association
Aggregation
Actor
Use Case
Instantiated
Class Instantiated Class Utility
Lock

Figure 42 Use-Case Diagram Toolbox

Use-Case Specification
A Use-Case Specification enables you to display and modify the properties
and relationships of a use case in the current model.
To display a Use-Case Specification, double-click on any icon representing
the use case or on the Browse menu, click Specifications.

Rational Rose 2000, Using Rose 115


Chapter 7 Use-Case Diagrams and Specifications

Specification Content

The Use-Case Specification contains the following tabs: General, Diagrams,


Relations, and Files.

Use-Case Specification—General Tab

Figure 43 Use-Case Specification General Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specifications
elements not covered in the following section.

Name
A use case name is often written as an informal text description of the
external actors and the sequences of events between elements that
make up the transaction. Use-case names often start with a verb. The
name can be entered or changed on the specification or directly on the
diagram.

116 Rational Rose 2000, Using Rose


Use-Case Specification

Package
This static field identifies the package to which the components belong.

Rank
The Rank field prioritizes use cases. For example, you can use the rank
field to plan what iteration in the development cycle a use case should
be implemented.

Abstract
An abstract notation indicates a use case that exists to capture
common functionality between use cases (uses) and to describe
extensions to a use case (extends).

Use-Case Specification—Diagram Tab

Figure 44 Use-Case Specification Diagram Tab

Rational Rose 2000, Using Rose 117


Chapter 7 Use-Case Diagrams and Specifications

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Diagrams
The Diagrams list box lists all the diagrams owned by the use case. The
diagram list consists of two columns. The first (unlabeled) column
displays the diagram icon type for the diagram. The second column
displays the diagram name. To insert a new diagram in the list, click
one of the Insert choices in the shortcut menu that corresponds to the
diagram type.

Use-Case Specification—Relations Tab

Figure 45 Use-Case Specification Relations Tab

Refer to the description in the in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

118 Rational Rose 2000, Using Rose


Use-Case Specification

Relations
The Relations list box lists all the relationships associated with the
selected use case. The client and supplier names and type icons are
displayed to the right of the relation name. Double-clicking on any
column in a row displays the element’s specification.

Generalize Specification—General Tab

Figure 46 Generalize Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
elements not covered in the following section.

Stereotype
Stereotypes allow you to provide additional distinctions in your model
that are not explicitly supported by the UML. The use of stereotypes
makes it easy to add information about modeling elements that may be
specific to a project or process.

Rational Rose 2000, Using Rose 119


Chapter 7 Use-Case Diagrams and Specifications

The Generalize Specification uses stereotypes to create two new use-


case relationships which can be attached to a model element to
indicate a special relationship between use cases.
Includes: This stereotype indicates that one use case employs the
functionality of another use case. The use case being used typically
contains functionality that a number of other use cases may need or
want.
Extends: This stereotype expresses optional or conditional behavior for
a use case. Extends (like Uses) indicates a special relationship between
use cases.

Friendship Required
Select the Friendship Required check box to specify that the supplier class
has granted rights to the client class to access its non-public members.

Virtual Inheritance
Select the Virtual Inheritance check box to ensure that only one copy of the
base class will be inherited by descendants of the subclasses.

Actor Specification
An Actor Specification looks identical to a Class Specification, except that the
stereotype field is set to actor. However, some of the fields in the class
specification are not applicable to actors and are therefore disabled.
Refer to the class specification in the Class Diagrams and
Specifications chapter for more information.

120 Rational Rose 2000, Using Rose


Chapter 8

State Machine Diagrams and


Specifications

The state/activity model icon that appears in the browser can be


thought of as a “container” for statechart and activity diagrams and all
of their model elements. A state/activity model owns statecharts and
activity diagrams and is represented semantically with a state
machine. A state machine can be defined as a behavior that specifies
the valid sequences of activities that an object or interaction goes
through during its life in response to events, together with its
responses and actions.
Rational Rose automatically creates one state/activity model when you
create a statechart or activity diagram. A state/activity model can be
relocated to a new owner, such as a class operation or a use case, by
dragging it to a new location in the browser. Rational Rose limits you
to only one state/activity model per owner.

Creating and Displaying a State Machine Diagram


To create a State/Activity Model, use the following steps:
1. Click Browse > State Machine Diagram.
2. Double-click New.
3. Name the diagram.
4. Specify the type of diagram you want to create: Activity or Statechart.
5. Click OK.

Rational Rose 2000, Using Rose 121


Chapter 8 State Machine Diagrams and Specifications

State Machine Specification


A State Machine Specification enables you to display and modify the
properties and relationships of a State/Activity Model. A state/activity
model contains statechart and activity diagrams.
To view the StateMachine Specification, double-click the State/Activity
Model in the browser.
Changes made either through the specification or directly on the icon
are automatically updated throughout the model.

Specification Content

The State Machine Specification consists of the following tab: General.

State Machine Specification General Tab

Figure 47 State Machine Specification General Tab

122 Rational Rose 2000, Using Rose


Statechart Diagram Overview

Statechart Diagram Overview


Statechart diagrams model the dynamic behavior of individual classes
or any other kind of object. They show the sequences of states that an
object goes through, the events that cause a transition from one state
or activity to another, and the actions that result from a state or activity
change.
Statechart diagrams are closely related to activity diagrams. The main
difference between the two diagrams is statechart diagrams are state
centric, while activity diagrams are activity centric. A statechart
diagram is typically used to model the discrete stages of an object’s
lifetime, whereas an activity diagram is better suited to model the
sequence of activities in a process.
Each state represents a named condition during the life of an object
during which it satisfies some condition or waits for some event. A
statechart diagram typically contains one start state and multiple end
states. Transitions connect the various states on the diagram. As with
activity diagrams, decisions, synchronizations, and activities may also
appear on statechart diagrams.

Creating a Statechart Diagram


You can create statechart diagrams on most model elements except for
attributes, associations, or model elements that appear in the
component view.
To create a statechart diagram, use the following steps:
1. In the browser, right-click on any model element except for
attributes, associations, or model elements that appear in the
component view.
2. Click statechart diagram from the New submenu.
Here is another way to create a statechart diagram:
1. Click the Browse State Machine Diagram button from the toolbar.
2. Click New.
3. Select the statechart diagram check box in the New State Machine dialog
box.
4. Enter the statechart diagram title.
5. Click OK.

Rational Rose 2000, Using Rose 123


Chapter 8 State Machine Diagrams and Specifications

Automatic Transmission Example

Figure 48 Automatic Transmission Example

Figure 48 illustrates some of the major pieces of a statechart diagram:


■ Decisions
■ Synchronizations
■ Activities
■ States
■ Transitions
■ Start States
■ End States

124 Rational Rose 2000, Using Rose


Activity Diagram Overview

Activity Diagram Overview


Activity diagrams provide a way to model the workflow of a business
process or a way to model a class operation. These diagrams are very
similar to a flowchart because you can model a workflow from activity
to activity or from activity to state.
Activity diagrams can model many different types of workflows. For
example, a company could use activity diagrams to model the flow for
an approval of orders or model the paper trail of invoices. An
accounting firm could use activity diagrams to model any number of
financial transactions. A software company could use activity diagrams
to model part of a software development process.
An activity diagram is considered a special case of a state machine in
which most of the states are activities and most of the transitions are
implicitly triggered by completion of the actions in the source activities.
The main difference between activity diagrams and statecharts is
activity diagrams are activity centric, while statecharts are state
centric. An activity diagram is typically used for modeling the sequence
of activities in a process, whereas a statechart is better suited to model
the discrete stages of an object’s lifetime.

Workflows
Each activity represents the performance of a group of “actions” in a
workflow. Once the activity is complete, the flow of control moves to the
next activity or state through a transition. If an outgoing transition is
not clearly triggered by an event, then it is triggered by the completion
of the contained actions inside the activity. A unique activity diagram
feature is a swimlane which defines “who” or “what” is responsible for
carrying out the activity or state. The workflow stops when a transition
reaches an end state.
You can attach activity diagrams to most model elements except for
attributes, associations, or model elements that appear in the
component view.
You can use the following tools on the activity diagram toolbox to model
activity diagrams:
■ Decisions
■ Swimlanes
■ Activities

Rational Rose 2000, Using Rose 125


Chapter 8 State Machine Diagrams and Specifications

■ States
■ Synchronizations
■ Transitions
■ Start State
■ End State

Creating an Activity Diagram


You can create activity diagrams on most model elements except for
attributes, associations, or model elements that appear in the
component view.
To create an activity diagram, use the following steps:
1. In the browser, right-click on any model element except for
attributes, associations, or model elements that appear in the
component view.
2. Click activity diagram from the New submenu.
3. Rename or double-click to display the NewDiagram icon in the
browser.
Here is another way to create a statechart diagram:
1. Click the Browse State Machine Diagram button from the toolbar.
2. Click New.
3. Select the activity diagram check box in the New State Machine dialog box.
4. Enter the activity diagram title.
5. Click OK.

Workflow Modeling
In business and in other industries, there are many manual and
automated systems that occur on a regular basis. Each of these
systems contains one or more workflows. A workflow is best defined as
a well-defined sequence of activities that produces an observable value
or objective to an individual or entity when performed.
The purposes of business modeling are threefold:
■ To understand the structure and dynamics of an organization

126 Rational Rose 2000, Using Rose


Modeling a Workflow with an Activity Diagram

■ To ensure that customers, end users, and developers have a


common understanding of the organization
■ To derive requirements on systems to support the organization
When you attempt to define a workflow, your activity diagram must
answer the following questions:
Who or what has the overall responsibility of the workflow?
■ A top-level package or class could own each diagram, for example.
What activities and states need to be performed to meet your objective
or goal?
■ Try to define all of the high-level activities and states that need to
take place in the workflow. You do not need to define every activity
or state, just the ones with the greatest importance in the
workflow.
Who will be responsible for performing the various activities and
states?
■ Each activity and state should be contained within a swimlane so
you know who is responsible for carrying out the activity or state.
Where do the activities and states take place with respect to other
elements on your model?
■ Placement of your activities on the model determines the order of
your workflow.
Why does this activity or state need to take place?
■ The reason or purpose for each activity or state should be placed in
the documentation field of the specification.

Modeling a Workflow with an Activity Diagram


Modeling a workflow in an activity diagram can be done several ways;
however, the following steps present just one logical process:
1. Identify a workflow objective. Ask, “What needs to take place or
happen by the end of the workflow? What needs to be
accomplished?” For example, if your activity diagram models the
workflow of ordering a book from an online bookstore, the goal of
the entire workflow could be getting the book to the customer.

Rational Rose 2000, Using Rose 127


Chapter 8 State Machine Diagrams and Specifications

2. Decide the pre and post-conditions of the workflow through a start


state and an end state. This clarifies the perimeter of the workflow.
3. Define and recognize all activities and states that must take place
to meet your objective. Place and name them on the activity
diagram in a logical order.
4. Decide who or what is responsible for performing the activities and
states through swimlanes. Name each swimlane and place the
appropriate activities and states within each swimlane.
5. Connect all elements on the diagram with transitions. Begin with
the “main” workflow.
6. Place decisions on the diagram where the workflow may split into
an alternate flow. For example, based on a Boolean expression, the
workflow could branch to a different workflow.
7. Evaluate your model and see if you have any concurrent
workflows. If so, use synchronizations to represent forking and
joining.
8. Set all actions, triggers and guard conditions in the specifications
of each model element.

Swimlanes
Swimlanes are helpful when modeling a business workflow because
they can represent organizational units or roles within a business
model. Swimlanes can only appear on activity diagrams and are very
similar to an object because they provide a way to tell who is
performing a certain role. You should place activities and states within
swimlanes to determine which unit is responsible for carrying out the
specific activity or state.

Common Statechart and Activity Diagram Model Elements


The following paragraphs contain the elements that can appear on
both statechart diagrams and activity diagrams.

States
A state represents a condition or situation during the life of an object
during which it satisfies some condition or waits for some event. Each
state represents the cumulative history of its behavior.

128 Rational Rose 2000, Using Rose


Modeling a Workflow with an Activity Diagram

Activities
An activity represents the performance of “task” or “duty” in a
workflow. It may also represent the execution of a statement in a
procedure. An activity is similar to a state, but expresses the intent
that there is no significant waiting (for events) in an activity.

Start and End States


A start state explicitly shows the beginning of a workflow on an activity
diagram or the beginning of the events that cause a transition on a
statechart. You can have only one start state on a statechart or activity
diagram.
An end state represents a final or terminal state on an activity diagram
or statechart diagram. Place an end state when you want to explicitly
show the end of a workflow on an activity diagram or the end of a
statechart diagram.

Transitions
A state transition indicates that an object in the source state will
perform certain specified actions and enter the destination state when
a specified event occurs or when certain conditions are satisfied. A
state transition is a relationship between two states, two activities, or
between an activity and a state.
You can show one or more state transitions from a state as long as each
transition is unique. Transitions originating from a state can not have
the same event, unless there are conditions on the event. Transitions
appear on statechart and activity diagrams.
You should label each state transition with the name of at least one
event that causes the state transition. You do not have to use unique
labels for state transitions because the same event can cause a
transition to many different states or activities.
Transitions are labeled with the following syntax:
event (arguments) [condition] / action ^ target.sendEvent
(arguments)
Only one event is allowed per transition, and one action per event.
Events, conditions and actions must be added by editing the label or
through the State Transition Specification.

Rational Rose 2000, Using Rose 129


Chapter 8 State Machine Diagrams and Specifications

Transition to Self
A transition to self is very similar to a state transition; however, it does
not move the focus of control to another state or activity when an event
occurs. A transition to self contains the same source and target state
or activity.
A transition to self contains actions and events just like transitions.
The icon for a transition to self is a looped line with an arrowhead
pointing toward the same source state or activity. The transition to self
arc appears on the top of an activity or state icon.

Decisions
A decision represents a specific location on an activity diagram or
statechart diagram where the workflow may branch based upon guard
conditions. There may be more than two outgoing transitions with
different guard conditions, but for the most part, a decision will have
only two outgoing transitions determined by a Boolean expression.

Synchronizations
Synchronizations enable you to see a simultaneous workflow in an
activity diagram or statechart diagram. They also visually define forks
and joins representing parallel workflow.

Swimlane Specification
A Swimlane Specification enables you to display and modify the
properties and relationships of a swimlane on an activity diagram.
To display a Swimlane Specification, select the swimlane header on an
activity diagram and double-click. You may also double-click on the
swimlane icon in the browser.

Specification Content

The swimlane specification consists of the following tab: General.

130 Rational Rose 2000, Using Rose


State and Activity Specifications

Swimlane Specification General Tab

Figure 49 Swimlane Specification General Tab

State and Activity Specifications


A State and Activity Specification enables you to display and modify the
properties and relationships of a state or activity on a statechart
diagram or activity diagram. Although a state and activity have almost
identical features, they are used for very different purposes. Also, start
and end states have identical features as a state specification. Start
and End States are actually states. However, they appear as circles on
statechart and activity diagrams.

Specification Content

The State, Activity, Start State, and End State Specifications consists of the
following tabs: General, Action, Transitions, and Swimlanes.

Rational Rose 2000, Using Rose 131


Chapter 8 State Machine Diagrams and Specifications

State and Activity Specification General Tab

Figure 50 State and Activity Specification General Tab

Information about the name, stereotype, owner, context,


documentation, state/activity history and sub state/activity history is
entered or displayed on this tab.
Refer to the descriptions in the Introduction to Diagrams and
Specifications chapter if you need information on the elements shown
on this specification.

State/Activity History

History provides a mechanism to return to the most recently visited


state when transitioning directly to a state with substates. History
applies to the level in which it appears. It may also be applied to the
lowest depth of nested states.
To apply history at the state or activity level, click State/activity history.
Click Sub state/activity history to apply history to all the depths of nested
states or activities within the state or activity level.

132 Rational Rose 2000, Using Rose


State and Activity Specifications

State and Activity Specification Actions Tab

Figure 51 State and Activity Specification Actions Tab

Information about the type and action expression is entered or


displayed on this tab.

Type
The Type field identifier bar lists the kind of action specified in the
Action Specification.

Action Expression
The Action Expression field identifier bar lists the four possible timing
options that specify when to carry out an action and it specifies the
types of actions that are carried out. You can modify the action settings
through the Action Specification Detail tab.
For information on the Actions Specification, refer to the Action
Specification.

Rational Rose 2000, Using Rose 133


Chapter 8 State Machine Diagrams and Specifications

State and Activity Specification Transitions Tab

Figure 52 State and Activity Specification Transitions Tab

Information about the icon, event and end is displayed on this tab.

134 Rational Rose 2000, Using Rose


Action Specification

State and Activity Specification Swimlanes Tab

Figure 53 State and Activity Specification Swimlanes Tab

Information about the swimlane name is displayed on this tab.

Action Specification
An Action Specification enables you to display and modify the action
properties in a statechart diagram or activity diagram.

How to Define a New Action

Use the following steps to define a new action on a state or activity from
a State or Activity Specification Actions tab:
1. While on the Actions tab of a State Specification or Activity Specification,
move the pointer to the Type and Action Expression fields and right-
click to display the shortcut menu.
2. Click Insert and an entry item is added.

Rational Rose 2000, Using Rose 135


Chapter 8 State Machine Diagrams and Specifications

3. Double-click on the entry to display the Action Specification.


4. Type the action description in the Name field. If this field is not
active, click Action on the Type field.
If you select Send Event, you may type optional arguments to the
triggered event in the Send Arguments field and the name of another
object in the model in the Send Target field.

State and Activity Actions

Each state and activity on a statechart or activity diagram may contain


any number of internal actions. An action is best described as a “task”
that takes place while inside a state or activity. There are four possible
actions within a state or activity:
■ On Entry
■ On Exit
■ Do
■ On Event

On Event

The On Event parameters are only enabled when you set the On Event
timing parameter.
Event - In a statechart or activity diagram, an event is an occurrence
that can trigger a state transition. Type the name of the event that will
trigger the action.
Arguments - Consists of any optional arguments associated with the
event.
Condition - May contain a conditional Boolean expression.
There is an advantage to using an On Event state action rather than a
transition to self. Transitions to self trigger all the actions associated
with a state, whereas state actions handle internal state transitions.
This provides you with the control to process an internal event without
triggering the entry and exit actions. The Trigger specification contains
the same features as the Action Specification. The Trigger Specification
defines the properties of a trigger.

Specification Content

The Action Specification consists of the following tab: Detail.

136 Rational Rose 2000, Using Rose


Transition Specification

Transition Specification
A State Transition Specification enables you to display and modify the
properties and relationships of a transition on a statechart diagram or
activity diagram. The state transition specification lists the events and
actions that comprise the transition.

Specification Contents

The State Transition Specification consists of the following tabs: General,


and Detail.

State Transition Specification – General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

Rational Rose 2000, Using Rose 137


Chapter 8 State Machine Diagrams and Specifications

State Transition Specification Detail Tab

Figure 54 State Transition Specification Detail Tab

Guard Condition
Conditional state transitions are triggered only when the conditional
expression evaluates to true. Conditions are denoted by surrounding
brackets:
Event (args) [condition] / Action ^target.someEvent (args)
To add a condition, click Condition on the State Transition
Specification and type the conditional expression. You may also
include a condition by selecting the event label and changing the text.

138 Rational Rose 2000, Using Rose


Decision Specification

Transition Between Substates


Transition between substates is useful when a transition is placed to
or from a substate that has been hidden from view. The From field
displays the state name from which the transition is initiated. The To
field displays the state name from which the transition is pointing.
Both fields are active at all times.
To enter a transition substate, click the scrolling arrow on the right
side of the field. A list of potential transition substates will be
presented. The list includes the name of all the states that reside within
the bounds of the top level superstate, including the superstate. Select
a state from the list.

Decision Specification
A Decision Specification enables you to display and modify the
properties and relationships of a decision on a statechart diagram or
activity diagram.
The Decision Specification consists of the following tabs: General, Transitions,
and Swimlanes.

Rational Rose 2000, Using Rose 139


Chapter 8 State Machine Diagrams and Specifications

Decision Specification General Tab

Figure 55 Decision Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

140 Rational Rose 2000, Using Rose


Decision Specification

Decision Specification Transitions Tab

Figure 56 Decision Specification Transition Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Rational Rose 2000, Using Rose 141


Chapter 8 State Machine Diagrams and Specifications

Decision Specification Swimlanes Tab

Figure 57 Decision Specification Swimlane Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Synchronization Specification
A Synchronization Specification enables you to display and modify the
properties and relationships of a synchronization on a statechart
diagram or activity diagram.
The Decision Specification consists of the following tabs: General and
Transitions.

142 Rational Rose 2000, Using Rose


Synchronization Specification

Synchronization Specification General Tab

Figure 58 Synchronization Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

Rational Rose 2000, Using Rose 143


Chapter 8 State Machine Diagrams and Specifications

Synchronization Specification Transitions Tab

Figure 59 Synchronization Specification Transitions Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

144 Rational Rose 2000, Using Rose


Chapter 9

Interaction Diagrams and Specifications

Interaction Diagram Overview


An interaction is an important sequence of interactions between
objects. Rational Rose provides two alternate views or representations
of each interaction—a collaboration and sequence diagram. These are
collectively referred to as interaction diagrams. There are two main
differences between sequence and collaboration diagrams: sequence
diagrams show time-based object interaction while collaboration
diagrams show how objects associate with each other.
You can specify and modify an interaction with either kind of diagram,
or with both. Rational Rose automatically reflects all changes made
either to a sequence or collaboration diagram in the corresponding
collaboration or sequence diagram, if one has been created.

Creating and Displaying an Interaction Diagram


To create or display a collaboration or sequence diagram you can
either:
■ Double-click on the interaction diagram icon located on the
toolbar.
1. Click Interaction Diagram located on the Browse menu.
2. The Select Interaction Diagram dialog box is displayed. Select a package
to “own” the diagram. On the right side of the dialog box, click the
diagram name, then click OK.

Rational Rose 2000, Using Rose 145


Chapter 9 Interaction Diagrams and Specifications

3. From the New Interaction Diagram dialog box, enter the diagram title
and click the diagram type. Your choices are Sequence or
Collaboration. Each diagram type is described in detail later in this
chapter.

Collaboration Diagrams
A collaboration diagram is an interaction diagram which shows the
sequence of messages that implement an operation or a transaction.
These diagrams shows objects, their links, and their messages. They
can also contain simple class instances and class utility instances.
Each collaboration diagram provides a view of the interactions or
structural relationships that occur between objects and object-like
entities in the current model.
You can create one or more collaboration diagrams to depict
interactions for each logical package in your model. Such collaboration
diagrams are themselves contained by the logical package enclosing
the objects they depict.
During analysis, collaboration diagrams can indicate the semantics of
the primary and secondary interactions.
During design, collaboration diagrams can show the semantics of
mechanisms in the logical design of the system.
Use collaboration diagrams as the primary vehicle to describe
interactions that express your decisions about the behavior of the
system. They can also be used to trace the execution of a scenario by
capturing the sequential and parallel interaction of a cooperating set of
objects.

146 Rational Rose 2000, Using Rose


Sequence Diagrams

Collaboration diagrams may also depict interactions that illustrate


system behavior.

Figure 60 Collaboration Diagram Example

Sequence Diagrams
A sequence diagram is a graphical view of a scenario that shows object
interaction in a time-based sequence—what happens first, what
happens next. Sequence diagrams establish the roles of objects and
help provide essential information to determine class responsibilities
and interfaces. Sequence diagrams are normally associated with use
cases.
This type of diagram is best used during early analysis phases in
design because they are simple and easy to comprehend. A sequence
diagram has two dimensions: typically, vertical placement represents
time and horizontal placement represents different objects.
Sequence diagrams are closely related to collaboration diagrams and
each are alternate representations of an interaction.

Rational Rose 2000, Using Rose 147


Chapter 9 Interaction Diagrams and Specifications

A sequence diagram traces the execution of a scenario in time. The


following example shows a sequence diagram:

Figure 61 Sequence Diagram Example

148 Rational Rose 2000, Using Rose


Toolboxes

Toolboxes
Each diagram type has its own unique toolbox. The collaboration and
sequence diagram toolboxes are illustrated in this section.

Collaboration Diagram Toolbox


The graphic below shows all the tools that can be placed on the
collaboration diagram toolbox. See Customizing the Toolbox on page 14
for information on adding or deleting tools on a diagram toolbox.
The application window displays the following toolbox when the
current window contains a collaboration diagram and you have
selected View > As Unified.
Note: Some icons will be different if you have selected View > As Booch or
View > As OMT.

Selector Text

Note Note Anchor


Object Class Instance
Object Link Link to Self

Link Message Reverse Link Message


Data Flow Reverse Data Flow

Lock

Figure 62 Collaboration Diagram Toolbox

Rational Rose 2000, Using Rose 149


Chapter 9 Interaction Diagrams and Specifications

Sequence Diagram Toolbox


The graphic below shows all the tools that can be placed on the
sequence diagram toolbox. See Customizing the Toolbox on page 14 for
information on adding or deleting tools on a diagram toolbox.
The application window displays the following toolbox when the
current window contains a sequence diagram and you have selected
View > As Unified.
Note: Some icons will be different if you have selected View > As Booch or
View > As OMT.

Selector Text

Note Note Anchor

Object Object Message

Message to Lock
Self

Figure 63 Sequence Diagram Toolbox

Note: The object and message icons are also found in the collaboration
toolbox.

Common Collaboration and Sequence Diagram Icons


There are a number of common tools that are used on both
collaboration and sequence diagrams. Although they may look slightly
different, they illustrate common concepts or elements. Tools unique
to a specific diagram type are discussed after this section.

Object
One of the primary elements of a collaboration or sequence diagram is
an object. An object has state, behavior, and identity. The structure
and behavior of similar objects are defined in their common class. Each
object in a diagram indicates some instance of a class. An object that
is not named is referred to as a class instance.

150 Rational Rose 2000, Using Rose


Toolboxes

The object icon is similar to a class icon except that the name is
underlined.
If you use the same name for several object icons appearing in the
same collaboration diagram, they are assumed to represent the same
object; otherwise, each object icon represents a distinct object. Object
icons appearing in different diagrams denote different objects, even if
their names are identical. Objects can be named three different ways:
object name, object name and class, or just by the class name itself.

Multiple Objects

If you have multiple objects that are instances of the same class, you
can modify the object icon by clicking Multiple Instances in the Object
Specification. When you select this check box, the icon is changed from
one object to three staggered objects.

To create an icon representing multiple objects:

1. Create an object.
2. Double-click on its icon to display its specification.
3. Click the Multiple Instances check box.
4. Click OK.
Rational Rose displays the Multiple Object icon:

Figure 64 Multiple Object Diagram

Messages
A message icon represents the communication between objects,
indicating that an action will follow.
Each message icon represents a message passed between two objects,
and indicates the direction of message is going. A message icon in a
collaboration diagram can represent multiple messages. A message
icon in a sequence diagram represents exactly one message.
A message is the communication carried between two objects that
triggers an event. A message carries information from the source focus
of control to the destination focus of control.

Rational Rose 2000, Using Rose 151


Chapter 9 Interaction Diagrams and Specifications

A message is represented on collaboration diagrams and sequence


diagrams by a message icon which visually indicates its
synchronization. The synchronization of a message can be modified
through the message specification.
If all messages represented by a message icon do not have the same
synchronization, the “simple” message icon is displayed. You can
change the synchronization of the message by editing the message
specification.
The sequence diagram toolbox contains two message tools: the
message icon tool appears as a horizontal arrow and the message to
self icon appears as a message that returns to itself.
The collaboration diagram toolbox contains two message tools. The
forward message tool, bearing an arrow pointing “northeast,” places a
message icon from client to supplier. The reverse message tool, bearing
an arrow pointing “southwest,” places a message icon from supplier to
client. The default synchronization for a message is “simple.”
Scripts may be attached to messages to enhance the messages.
If a message is deleted, the link on the collaboration diagram remains
intact.

To create a client-to-supplier message and assign it to a link


between two objects (collaboration diagram only):

1. Click the Message icon.


2. Click on an icon representing the link.
Rational Rose creates an unnamed, empty message assigned to the
designated link. The source of this message is the client object, and the
destination of this message is the supplier object.
To create a supplier-to-client message, use the Reverse Message Creation
tool in the above procedure. The source of the resulting message is the
supplier-object, and the destination of this message is the client-
object.

To name an unnamed message:

1. Click the icon representing the message.


2. Type the name.
3. Click outside the named icon.

152 Rational Rose 2000, Using Rose


Toolboxes

Rational Rose will name the message as specified, and assign it a


sequence number based on creation order, starting with 1.

To Change Message Names in Interaction Diagrams:

1. Click on the name to display a flashing vertical bar that designates


the insertion point.
2. Backspace and enter additional text.
3. Click outside the named icon.
Alternatively, you can double-click on an icon representing the
message to display the message specification; modify the Name field and
click OK.

Message Numbering
To enable or disable the display of message numbers click Tools >
Options. Click on the Diagram tab and click Collaboration Numbering (for
collaboration diagrams) or Sequence Numbering (for sequence diagrams).

To Change Messages Numbering in Interaction Diagrams:

1. Create or display the interaction’s sequence diagram, click Browse >


Create Sequence Diagram or Browse > Go to Sequence Diagram.
2. Reorder the messages by dragging the message icons into the
preferred order.
3. Redisplay the interaction diagram by clicking Browse > Go to
Collaboration Diagram or Browse > Go to Sequence Diagram.

Assigning an Operation to a Message


Rational Rose enables you to assign an operation to a message by
presenting a list of all operations accepted by the destination object.
The list of valid operations is defined by the specification of the object’s
parent class, and the specifications of the parent class’ superclasses,
as specified by its inheritance hierarchy. The Class field of the
destination object’s specification must therefore be set to identify the
destination object’s parent class before operations can be assigned to
a message to that destination object.
Assigning an operation to a message changes the name of the message
to the name of the operation.

Rational Rose 2000, Using Rose 153


Chapter 9 Interaction Diagrams and Specifications

To assign an operation to a message:

1. Right-click on the message icon.


2. Click an operation from the pop-up list, or click <new operation> to
add and specify a new operation to the destination object’s class
specification.
If you click <new operation>, you must repeat this procedure after
specifying the new operation to assign the newly-created operation to
the message.
You can associate multiple messages with a message icon. Each new
message is represented by an independent name and sequence
number. If a message icon represents multiple messages, you must
select a specific message by clicking on its name.
You can also create multiple messages associated with the same
message icon using the link specification. This method is described in
the Link Specification section in this chapter.
To change a message’s assigned operation, display its specification by
double-clicking on its message icon. If the message icon represents
multiple messages, double-click on the name of the message whose
operation you select to change. Select the desired operation from the
specification’s Referenced Operation field, or directly enter an operation
name in the Name field.

Collaboration Specific Toolbox Icons

Links
Objects interact through their links to other objects. A link is an
instance of an association, analogous to an object being an instance of
a class.
A link should exist between two objects, including class utilities, only
if there is a relationship between their corresponding classes. The
existence of a relationship between two classes symbolizes a path of
communication between instances of the classes: one object may send
messages to another.
Links can support multiple messages in either direction. If a message
is deleted, the link remains intact.

154 Rational Rose 2000, Using Rose


Sequence Numbering

The link is depicted as a straight line between objects or objects and


class instances in a collaboration diagram. If an object links to itself,
use the loop version of the icon.

To create a link between two objects:

1. Click the Link tool.


2. Drag the pointer between the two object icons.
Rational Rose will create and display an unnamed link.

To create a reflexive link a link between an object and itself:

1. Click the Link to Self tool.


2. Click on an icon representing the object.
Rational Rose will create and display an unnamed reflexive link.

Sequence Numbering
Sequence numbering allows you to clearly see how messages interact
and relate to one another. Numbering messages can be done two ways
on sequence diagrams: top level numbering; in a 1, 2, 3, pattern or
hierarchical numbering; in a 1.1, 1.1.2, 1.1.3, pattern. Only top level
numbering is available on collaboration diagrams. However, if you
create a collaboration diagram from a sequence diagram with
hierarchal numbering the hierarchal numbering is retained.

Top-Level Numbering
Top-level numbering gives each message or message to self a single
number. There are no number subsets. Top-level numbering is useful
in small sequence diagrams with few objects and messages.

Hierarchical Numbering
Hierarchical numbering bases all messages on a dependent message.
For example, you could have messages numbered 1., 1.1, 1.2, 1.2.1,
where message number 1 is an independent message. All other
message numbers numbered 1.x and beyond are dependent on
message 1. If you remove independent message 1 from the diagram, all
dependent messages will be removed as well.

Rational Rose 2000, Using Rose 155


Chapter 9 Interaction Diagrams and Specifications

To Display Hierarchical Numbering:

1. Click Options from the Tools menu.


2. Click the Diagram tab.
3. Click on the Sequence Numbering check box.
4. Click on the Hierarchical Messages check box.

Scripts
Scripts are used to enhance messages on sequence diagrams. They are
simply text fields that attach to messages.

To create and attach a script:

1. Click on the message icon and drag between two objects.


2. Create text by either:
❑ Using the ABC icon.
❑ Clicking Text from the Create option on the Tools menu.
3. Select one or more labels.
❑ Select the CTRL or SHIFT key to enable multiple selections.
4. Select ONE message.
❑ The order of steps 2 & 3 is inconsequential.
5. Click Edit > Attach Script.
❑ The script is now attached to the message.

To move a script:

1. Select the message and move with the drag technique.


❑ The script moves next to the message.
2. Select only the script and move with the drag technique.
❑ The script moves independently of the message.

To detach a script:

1. Select either script or message.


2. Click Edit > Detach Script.

156 Rational Rose 2000, Using Rose


Focus of Control

To delete a(n):

1. Message
❑ All dependent messages and attached scripts are deleted.
or...
2. Script
❑ Script is deleted with no effect on the messages.
or...
3. Object
❑ All messages and attached scripts are deleted.

To undo:

1. Click Edit > Undo will reverse the latest change.

Focus of Control
Focus of Control (FOC) is an advanced notational technique that
enhances sequence diagrams. This technique shows the period of time
during which an object is performing an action, either directly or
through an underlying procedure.
FOC is portrayed through narrow rectangles that adorn lifelines (the
vertical lines descending from each object). The length of a FOC
indicates the amount of time it takes for a message to be performed.
When you move a message vertically, each dependent message will
move vertically as well. Also, you can move a FOC vertically off the
source FOC to make it detached and independent.

Rational Rose 2000, Using Rose 157


Chapter 9 Interaction Diagrams and Specifications

A sequence diagram with FOC notation and scripts follows:

Figure 65 Focus of Control Diagram Example

Displaying Focus of Control


To enable or suppress the Focus of Control notation on a sequence
diagram:
1. Click Tools > Options.
2. Click the Diagram tab.
A check mark beside Focus of Control means that the notation will be
displayed.

Coloring Focus of Control


To help distinguish a particular FOC from other items in a sequence
diagram, you can fill a FOC with a color. To color a FOC:
1. Select the message icon that enters the FOC you want to color.
2. Click Format > Fill Color.
3. Click on the color you want to make the selected FOC.
4. Click OK.

158 Rational Rose 2000, Using Rose


Creating Alternative Diagrams

Moving the Focus of Control


Sometimes it is helpful to move the starting point of a FOC and all
corresponding messages. If the FOC has an entry point message, you
can move the message. Otherwise, use the following steps to move the
FOC on a sequence diagram:
1. Select the first message from the FOC you want to move.
2. Hold the ALT key down.
3. Grab the source message and move it to the desired location on a
sequence diagram. Note how the source FOC changes locations.

Nested Focus of Control


A Nested Focus of Control is a FOC that resides on another FOC.
Nested FOC allows you to distinguish exactly where a message starts
and where it ends. If you want to add a message to an existing
sequence diagram, the Nested FOC feature helps you determine where
to place it.

Creating Alternative Diagrams


The Create Collaboration Diagram command creates a collaboration diagram
from information contained in the sequence diagram. The Create
Sequence Diagram command creates a sequence diagram from
information contained in the interaction’s collaboration diagram. The
Go to Sequence Diagram and Go to Collaboration Diagram commands traverse
between an interaction’s two representations.

Creating a Collaboration Diagram from a Sequence Diagram


To create a collaboration diagram from a sequence diagram, click
anywhere on the sequence diagram and click Create Collaboration Diagram
from the Browse menu. Note that if this collaboration diagram already
exists, the Browse menu will instead present the Go to Collaboration Diagram
option.

Rational Rose 2000, Using Rose 159


Chapter 9 Interaction Diagrams and Specifications

Creating a Sequence Diagram from a Collaboration Diagram


To create a sequence diagram from a collaboration diagram, click
anywhere on the collaboration diagram and click Create Sequence Diagram
from the Browse menu. Note that if this sequence diagram already
exists, the Browse menu will instead present the Go to Sequence Diagram
option. Class instances in the collaboration diagram are represented as
objects in the sequence diagram.

Object Specification
An object specification enables you to display and modify the
properties and relationships of an object in the current model.
To display an Object Specification, double-click on any icon representing
an object or on the Browse menu, click Specifications.

Specification Content

The Object Specification consists of the following tab: General.

160 Rational Rose 2000, Using Rose


Object Specification

Object Specification—General Tab

Figure 66 Object Specification General Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Name
If you specify the name of the object’s class in the Object Specification, the
name must identify a class defined in the model.

Rational Rose 2000, Using Rose 161


Chapter 9 Interaction Diagrams and Specifications

Class
The Class field displays the name of the object’s parent class. The
default class for a newly created object is Unspecified.
The object will accept messages conveying the operations of its parent
class, and the operations of the superclasses of its parent class.
If you subsequently delete the class from the model, its name will be
displayed in parentheses. If you recreate the class or create a new class
with the same name, the object becomes an instance of this class.

Persistence Field
Use these options to specify the object’s persistence:
Table 12 Persistence Field Options

Type Description

Persistent The object exists after the termination of the


program in which it was created.

Static The object exists during the entire execution of


a program.

Transient The object is created and destroyed dynamically


during the execution of a program.

To display an object’s persistence in a collaboration diagram, right-


click on an icon representing the object to display the shortcut menu
and click Show Persistence.

Multiple Instances Check Box


Check the Multiple Instances check box to indicate that this object
represents multiple instances of the same class. When you select this
field, the icon changes from one object to three staggered objects. The
object group is considered one entity, but this icon indicates that
several objects are involved.

162 Rational Rose 2000, Using Rose


Class Instance Specifications

Class Instance Specifications


A class instance places a representation of a class on a collaboration
diagram.
To display an Class Instance Specification, double-click on any icon
representing an class instance or on the Browse menu, click Specifications.

Specification Content

The Class Instance Specification consists of the following tab: General.

Class Instance Specification—General Tab

Figure 67 Class Instance Specification General Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
specification elements not covered in the following section.

Rational Rose 2000, Using Rose 163


Chapter 9 Interaction Diagrams and Specifications

Class
The class the element belongs to is displayed here. The default class for
a newly created element is (Unspecified). If you specify an object’s class
in the Object Specification, the class name must identify a class defined in
the model, or you may create a new class.
To create a new class through the Object Specification, click the scroll
arrow on to the right of the Class field. A list box will display all the
possible class selections, including <New>. Double-click on <New>. A
Class Specification dialog box is displayed. Enter the information
regarding the new class.
If you delete a class from the model after you have associated it with
one or more objects, the class name is enclosed in parentheses. If you
re-create the class or create a new class with the same name, the object
becomes an instance of the new class.
You can set this field only through the dialog box.

Link Specification
A link is the path of communication between two objects. A link can
exist between two objects, between an object and a class instance, or
between an object and itself.
To display a Link Specification, double-click on any icon representing a
link or click Browse > Specifications.

Specification Content

The Link Specification consists of the following tabs: General and Messages.

164 Rational Rose 2000, Using Rose


Link Specification

Link Specification—General Tab

Figure 68 Link Specification General Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Assoc
The Association field lists any valid role(s) or association(s) tied to the
classes belonging to the two objects.
Select an association from the drop-down list. The name of the role tied
to the association is displayed beside the link on the diagram. The keys
are displayed in brackets under the role, and the constraints are
displayed in braces under the keys.

Rational Rose 2000, Using Rose 165


Chapter 9 Interaction Diagrams and Specifications

Supplier & Client Visibility


Visibility is the ability of one object to see another object.
You can specify the following visibility types for the supplier object, the
client object or both:
Table 13 Supplier & Client Visibility Options

Type Description

Unspecified (Default) The object visibility has not been


specified.

Field The supplier object is visible because it


is a field of the client.

Parameters The supplier object is visible to the client


because it is a parameter for one of the
client’s operations.

Local The supplier is local to an operation of


the client object.

Global The supplier object is global to client.

An object visibility adornment is a letter inside a box placed at the


supplier end of the link. Each letter identifies the type of visibility used.
The adornment box is either open (shared) or filled (unshared).
You can set link visibility through the Link Specification or through the
shortcut menu. These fields correspond to visibility adornments
displayed in the collaboration diagram.
■ To set visibility for the supplier object, click on a visibility type in
the Supplier Visibility section.
■ To set visibility for the client object, click on a visibility type in the
Client Visibility Section.
The visibility adornment is placed at the appropriate end of the link.
The unspecified object visibility does not have a corresponding
visibility adornment. Use this adornment only when you need to
document an important tactical decision.

166 Rational Rose 2000, Using Rose


Link Specification

Shared
If visibility is an important detail in your software model, use visibility
adornments to show these details in a collaboration diagram.
Shared visibility indicates structural sharing of the given object; that
is, the shared object’s state can be altered through more than one path.
Unshared visibility represents unique access given to the client object.
When you create a link, unshared visibility is the default.
You can set the shared indicators in the Link Specification or by selecting
a visibility value from the shortcut menu.
To toggle the shared indicator, click on the Shared check box below the
appropriate visibility section.
■ If you specify shared visibility, the visibility adornment changes
from a filled square to an open square of the corresponding type.
■ If you specify unshared visibility, the visibility adornment changes
to a filled square of the corresponding type.

Role
This field lists the role names tied to the selected associations. This is
especially useful since many associations are not named. This field
cannot be edited.
Note: The Link to Self Specification contains only the Name, Visibility
and Shared elements.

Rational Rose 2000, Using Rose 167


Chapter 9 Interaction Diagrams and Specifications

Link Specification—Messages Tab

Figure 69 Link Specification Message Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.
You can add a message either directly on the diagram or through Insert
on the shortcut menu.

Icon
This left-most unlabeled field contains a small version of the link
message icon indicating the direction of the message.

Sequence
This is a system-assigned, sequential message number.

168 Rational Rose 2000, Using Rose


Message Specification

Message Name
Click on the item to see the Picklist box showing all available
operations on the class. This is the only editable column on this tab.

Receiver
This is the object receiving the message.
Note: You can double-click on every field except the icon field to display
the message specification.

Message Specification
A message conveys an operation through a link between objects. A
message’s specification identifies the operation it conveys, its
synchronization, its frequency, and its associated documentation.
To display a Message Specification, double-click on any icon representing
a message or on the Browse menu, click Specifications.

Specification Content

The Message Specification consists of the following tabs: General and Detail.

Rational Rose 2000, Using Rose 169


Chapter 9 Interaction Diagrams and Specifications

Message Specification—General Tab

Figure 70 Message Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the elements not
covered in the following section.

Class
The Class field displays the name of the class to which the element
belongs.

170 Rational Rose 2000, Using Rose


Message Specification

Message Specification—Detail Tab

Figure 71 Message Specification Detail Tab

Refer to the description in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Rational Rose 2000, Using Rose 171


Chapter 9 Interaction Diagrams and Specifications

Synchronization
Use these options to specify concurrency semantics for the operation
named in the Synchronization field:
Table 14 Synchronization Options

Type Description

Simple (default) The message has a single thread of control.

Synchronous The operation proceeds only when the client


sends a message to the supplier and the
supplier accepts the message.

Balking The client passes a message only if the supplier


is immediately ready to accept the message; the
client abandons the message if the supplier is
not ready.

Timeout The client abandons a message if the supplier


cannot handle the message within a specified
amount of time.

Asynchronous The client sends a message to the supplier for


processing and continues to execute its code
without waiting for or relying on the supplier’s
receipt of the message.

Frequency
Use these options to indicate whether the message is sent periodically
or aperiodically:
Table 15 Frequency Options

Type Description

Aperiodic The message is sent at irregular intervals, or


does not have a regular interval.

Periodic The message is sent at regular intervals.

172 Rational Rose 2000, Using Rose


Chapter 10

Component Diagrams and


Specifications

Component Diagram Overview


A component diagram shows the physical dependency relationships
(mapping to a file system) between components—main programs,
subprograms, packages, and tasks—and the arrangement of
components into component packages.

Figure 72 Component Diagram Example

Component diagrams are contained (owned) either at the top level of


the model, or by a package. This means the diagram will depict the
components and packages where the diagram is contained.

Rational Rose 2000, Using Rose 173


Chapter 10 Component Diagrams and Specifications

Creating and Displaying a Component Diagram


You can create or display the component diagram in one of three ways:
■ Click Browse > Component Diagram.
■ On the toolbar, double-click the component diagram icon.
■ In the browser, double-click on the component diagram icon.

Component Diagram Toolbox


The application window displays the following toolbox when the
current window contains a component diagram and As Unified is selected
from the View menu.

Selector Text

Note Note Anchor

Component Package

Dependency Subprogram
Specification
Generic
Subprogram Body Specification
Main Program Package Specification
Package Body Generic Package

Task Specification Task Body

Lock

Figure 73 Component Diagram Toolbox

Assigning a Component to Another Package


Every component is assigned to a package. When you create a
component using a creation tool from the component diagram toolbox,
the component is assigned to the package containing the component
diagram.

174 Rational Rose 2000, Using Rose


Component Specifications

To reassign a component from one package to another:


1. Select a component icon in a diagram directly contained by the
package to which the component should be assigned. (You might
need to create such a diagram or icon if one does not currently
exist.)
2. Click Edit > Relocate.
Rational Rose will update all component diagrams to reflect the
component’s new assignment.
Like components, packages are also assigned to packages—permitting
nesting to an arbitrary depth. The mechanisms previously described
can be applied to packages as well as components.

Component Specifications
A Component Specification displays and modifies the properties and
relationships of each component in the current model. The same
specification is used for all component kinds.
Some of the information on this specification can also be displayed
inside icons representing the component in a component diagram.
To display a Component Specification, double-click on any icon
representing the component or click Browse > Specifications.

Specification Content

The Component Specification consists of the following tabs: General, Detail,


Realizes, and Files.

Rational Rose 2000, Using Rose 175


Chapter 10 Component Diagrams and Specifications

Component Specification—General Tab

Figure 74 Component Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the elements shown
on this specification tab.

Stereotype (Component)
A component stereotype represents the subclassification of an element.
The most common type of components are already predefined as
stereotypes, including Main Program, Package Body, Package
Specification, Subprogram Body, Subprogram Specification, Task
Body and Task Specification. You can also define and add your own
kinds of stereotypes.

Language
This field identifies the implementation language that is assigned to
this component.

176 Rational Rose 2000, Using Rose


Component Specifications

Note that when changing the implementation language of a


component, the data types that are used in the specification of
operations and attributes of the assigned classes, are not
automatically converted to data types in the new implementation
language. Also, if you change the implementation language for a
component with classes that are assigned to other components, a
dialog box is displayed where you have to decide how to handle those
classes.

Component Specification—Detail Tab

Figure 75 Component Specification Detail Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Rational Rose 2000, Using Rose 177


Chapter 10 Component Diagrams and Specifications

Declarations
The Declarations field contains a list of declarations, such as class
names, variables, and other language-specific features (such as
#includes or similar constructs). Declarations can include classes,
objects and any other language-specific declarations.
Use this field to list the elements that physically reside in the
component. You can view this field only through the component
specification.

Component Specification—Realizes Tab

Figure 76 Component Specification Realizes Tab

Refer to description in the Introduction to Diagrams and Specifications


chapter if you need information on the specification elements not
covered in the following section.

178 Rational Rose 2000, Using Rose


Component Specifications

Show all Classes


Select this check box if you want to view a list of all classes in the
model. If this option is not selected, you will see only the classes that
are assigned to this component.

Classes
The list identifies the classes and interfaces that are assigned to this
component (indicated with check marks). The Logical Package column
shows to which package a class belongs, and the Language column
shows the programming language that is assigned to a specific class.
You assign a class or interface to a component through Assign on the
shortcut menu in the list, or by dragging a class or interface from the
browser and dropping it in this list. Note that you can only assign
classes that are unassigned, or classes that are assigned to
components with the same implementation language as this
component.

Language
This field identifies the implementation language that is assigned to
this component.
Note that when the changing the implementation language of a
component, the data types that are used in the specification of
operations and attributes of the assigned classes, are not
automatically converted to data types in the new implementation
language. Also, if you change the implementation language for a
component with classes that are assigned to other components, a
dialog box is displayed where you have to decide how to handle those
classes.

Component Specification—Files Tab


Refer to the descriptions in the Introduction to Diagrams and
Specifications chapter if you need information on this tab.

Rational Rose 2000, Using Rose 179


Chapter 10 Component Diagrams and Specifications

Package Specification
A Package Specification displays and modifies the properties and
relationships of a package in the current model.
To display a Package Specification, double-click on any browser icon
representing the package or click Browse > Specifications.
The Package Specification consists of the following tabs: General, Detail,
Realizes and Files.

Package Specification—General Tab

Figure 77 Package Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the elements of this
specification not covered in the following section.

180 Rational Rose 2000, Using Rose


Package Specification

Package
The package the component belongs to is displayed in this static field.

Package Specification—Detail Tab

Figure 78 Package Specification Detail Tab

Component Diagrams
This field lists the component diagrams contained in the package. You
can create a new component diagram in the package through Insert on
the shortcut menu, or click Browse > Component Diagram. You may rename
or delete existing component diagrams from this field.
To display a specific component diagram listed in this field, double-
click on its entry.

Rational Rose 2000, Using Rose 181


Chapter 10 Component Diagrams and Specifications

Package Specification—Realizes Tab


Refer to description earlier in this chapter if you need information on
this tab.

Package Specification—Files Tab


Refer to the descriptions in the Introduction to Diagrams and
Specifications chapter if you need information on this tab.

182 Rational Rose 2000, Using Rose


Chapter 11

Deployment Diagrams and


Specifications

Deployment Diagram Overview


A deployment diagram shows processors, devices, and connections.
Each model contains a single deployment diagram that shows the
connections between its processors and devices, and the allocation of
its processes to processors.

Figure 79 Deployment Diagram Example

Rational Rose 2000, Using Rose 183


Chapter 11 Deployment Diagrams and Specifications

Creating and Displaying a Deployment Diagram


You can create or display the deployment diagram in one of three ways:
■ Click Browse > Deployment Diagram.
■ On the toolbar, double-click on the deployment diagram icon.
■ In the browser, double-click on the deployment diagram icon.

Deployment Diagram Toolbox


The application window displays the following toolbox when the
current window contains a deployment diagram and you have selected
View > As Unified:

Selector
Text

Note Note Anchor

Processor Connection

Device Lock

Figure 80 Deployment Diagram Toolbox

Processor Specification
A Processor Specification displays and modifies the properties and
relationships of a processor in the current model. Some of the
information on the specification can also be displayed inside icons
representing the processor in a model’s deployment diagram.
To display a Processor Specification, double-click on any icon representing
a processor or click Browse > Specifications.

Specification Content

The Processor Specification consists of the following tabs: General and Detail.

184 Rational Rose 2000, Using Rose


Processor Specification

Processor Specification—General Tab

Figure 81 Processor Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the elements shown
on this specification.

Rational Rose 2000, Using Rose 185


Chapter 11 Deployment Diagrams and Specifications

Processor Specification—Detail Tab

Figure 82 Processor Specification Detail Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

Characteristics
Use the Characteristics field to specify a physical description of an
element. For example, you can describe the kind and bandwidth of a
connection, the manufacturer, model, memory, and disks of a
machine, or the kind and size of a device. You can set this field only
through the specification. This information is not displayed in the
deployment diagram.
To update this field, click in the Characteristics field and enter the
information.

186 Rational Rose 2000, Using Rose


Processor Specification

Processes
Use this field to identify the processes assigned to this processor.
Processes denote either the root of a main program from a component
diagram or the name of an active object from a collaboration diagram.
To create a process, place the pointer in the Processes area and click
Insert using the shortcut menu. A NewProcess entry is created. To
change the name or priority, click the item and type the changes.
You can display a list of the processes by selecting the processor icon
and clicking Show Processes from the shortcut menu.

Scheduling
The Scheduling field specifies the type of process scheduling used by the
processor. Use these options to specify the appropriate scheduling:
Table 16 Scheduling Field Options

Type Description

Preemptive Higher-priority processes that are ready to


execute can preempt lower-priority processes
that are currently executing. Processes with
equal priority are given a time slice in which to
execute, allowing computation resources to be
fairly distributed (default).

Non preemptive The current process continues to execute until


it relinquishes control.

Cyclic Control passes from one process to another;


each process is given a fixed amount of
processing time.

Executive An algorithm controls process scheduling.

Manual Processes are scheduled by a user outside of


the system.

You can set this field only through the specification. To set the
scheduling type, click on the applicable option button in the Scheduling
field.
You can display the scheduling type in the processor icon by clicking
Show Scheduling form the shortcut menu.

Rational Rose 2000, Using Rose 187


Chapter 11 Deployment Diagrams and Specifications

Device Specification
A Device Specification displays and modifies the properties and
relationships of a device in the current model. Some of the information
on this specification can also be displayed inside icons representing
the device in a deployment diagram.
To display a Device Specification, double-click on any icon representing a
device or click Browse > Specifications.

Specification Content

The Device Specification consists of the following tabs: General and Detail.

Device Specification—General Tab

Figure 83 Device Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the elements shown
on this specification.

188 Rational Rose 2000, Using Rose


Connection Specifications

Device Specification—Detail Tab

Figure 84 Device Specification Detail Tab

Refer to the descriptions earlier in this chapter or in the Introduction to


Diagrams and Specifications chapter if you need information on the
elements shown on this specification.

Connection Specifications
A Connection Specification indicates a communication path between two
processors, two devices, or a processor and a device. A connection
usually represents a direct hardware coupling, such as an RS232
cable. It can also represent an indirect coupling.
To display a Connection Specification, double-click on any icon
representing a connection or click Browse > Specifications.
The Connection Specification consists two tabs, which contain the same
elements as the Device Specification, and is not repeated here.

Rational Rose 2000, Using Rose 189


Chapter 11 Deployment Diagrams and Specifications

Process Specification
Processes are threads of control that execute on a processor. One
process specification documents one thread of control.
You access the Process Specification through the Processes field of a
Processor Specification. None of the information contained in the Process
Specification is displayed in a diagram; thus, process properties can only
be viewed and modified through a Process Specification.

Specification Content

The Process Specification consists of the following tabs: General.

Process Specification—General Tab

Figure 85 Process Specification General Tab

Refer to the descriptions in the Introduction to Diagrams and


Specifications chapter if you need information on the specification
elements not covered in the following section.

190 Rational Rose 2000, Using Rose


Process Specification

Processor
The owner of the process is shown here.

Priority
This field contains the relative priority of this process, if there is one.
You can use this information with the scheduling type identified in the
Processor Specification to schedule process execution.

Rational Rose 2000, Using Rose 191


Chapter 12

Framework Wizard Add-In

The Framework Wizard Add-In provides a library of frameworks that


can be used as templates when creating new models. If the Framework
Wizard Add-In is active, the File > New command in Rational Rose
displays a dialog box from which you can choose one of the available
frameworks. By choosing an appropriate framework when you create a
new model, the model is automatically initialized with a predefined
architecture and a set of reusable model elements. This way, you can
focus your modeling efforts on the parts that are unique to your
system, instead of “reinventing the wheel.”
The Framework Wizard Add-In also provides a wizard to help you add
additional frameworks. The Wizard is started by opening the “Make
New Framework” framework.
Note: The Framework Wizard Add-In is only available on Windows, and
only in some Rational Rose editions. Also, in order to create models from
frameworks and add new frameworks, the Framework Wizard Add-In
must be active (see the Activating the Framework Wizard Add-In
section.)

Activating the Framework Wizard Add-In


In order to create models from frameworks and add new frameworks,
the Framework Wizard Add-In it must be active. It is active if the File >
New command in Rational Rose displays a Create New Model dialog box. If
the File > New command just opens a new empty model, the Framework
Wizard Add-In is not active.

Rational Rose 2000, Using Rose 193


Chapter 12 Framework Wizard Add-In

To Install the Framework Wizard Add-In

1. Run the Rational Rose setup program.


2. Select a custom install, and select the Rose Framework Add-In
feature. If the Framework Wizard Add-In feature is not present, the
add-in is not available in your Rational Rose edition.

To activate the Framework Wizard Add-In:

1. Click Add-Ins > Add-In Manager in Rational Rose.


2. Select the Framework Wizard option and click OK. If the option is not
present, the Framework Wizard Add-In is not installed.

Creating a New Model from a Framework


To create a new model from a framework, use the following steps:
1. Click File > New. The Create New Model dialog opens.

Figure 86 Create New Model Dialog Box

194 Rational Rose 2000, Using Rose


Creating and Deleting Frameworks

2. Open the framework that corresponds to the system you are going
to develop. A new model is created and initialized with the contents
of the chosen framework. (If you don’t want to use any of the
frameworks, click Cancel. A new model with only the default
contents is created.)
3. Save the new model and give it a name by clicking File > Save As.
Note: Each package in a framework is stored as a controlled unit in a
separate file. To access the contents of a package in a framework, you
have to load the corresponding controlled unit. To load a unit, double-
click on the package in a diagram, or click File > Units and click Load.

Creating and Deleting Frameworks


Rational Rose provides you with a Framework Wizard that helps you
create a new framework and add it to the framework library. To use the
Framework Wizard, the Framework Wizard Add-In must be installed
and activated (see the Activating the Framework Wizard Add-In
section).

The Framework Library


The Framework Wizard Add-In provides a library of predefined
frameworks. The frameworks are located in the
\Framework\Frameworks folder in your Rational Rose installation
folder. When creating a new model, you can choose to create the model
from one of the listed frameworks. The set of available frameworks are
displayed with the File > New command.
In the framework library, all files that work together to define a specific
framework are located in a folder with the same name as the
framework. Each framework is defined by the following files:
■ FrameworkName.mdl, which contains the model framework itself.
This model is an ordinary Rational Rose model.
■ FrameworkName.ico, which includes the icon that symbolizes the
framework in the Create New Model dialog box. If there is no .ico file,
Rational Rose displays a default icon for the framework.
■ FrameworkName.rtf, which includes a description of the
framework, which is shown in the Create New Model dialog box when
the user clicks Details. If there is no .rtf file, Rational Rose
displays a default description text.

Rational Rose 2000, Using Rose 195


Chapter 12 Framework Wizard Add-In

■ Parameters, which holds the name of the diagram that is initially


opened for models created from this framework. The Framework
Wizard automatically creates this file and enters the name of the
diagram as a line with the following syntax:
“StartDiagram=ParentPackage / DiagramName.” For example:
“StartDiagram=Logical View / Framework Overview.”

Creating a New Framework


To create a new framework, perform the following steps:
1. Create and save a model with the contents of the framework in any
folder. That model will be used as the template when creating new
models from this framework.
2. Optionally, write a description of the framework in any word
processor and save the document in RTF (Rich Text Format) format
in any folder.
3. Optionally, use a drawing tool to create an icon that symbolizes the
new framework. Save the icon as an .ico file in any folder. (Or look
for a suitable existing .ico file.)
4. Click File > New. The Create New Model dialog box opens.
5. Open the “Make New Framework” framework, which starts the
Framework Wizard. (If the welcome page is shown, click Next.

Figure 87 Framework Wizard Specification Page

196 Rational Rose 2000, Using Rose


Creating and Deleting Frameworks

6. In the Framework Name field, specify the name of the new framework.
The name must be unique among the existing frameworks, and it
can only contain characters that are allowed in folder names.
7. In the Model File field, specify the name and location of the file that
constitute the framework model. To browse to the file, click in the
field. Then click the displayed button.
8. Optionally, click in the Start Diagram field to specify a diagram that is
to be initially opened for models created from this framework. The
specified model opens. Click the arrow to the right of the Start
Diagram field and select one of the diagrams.
9. Optionally, specify the name and location of the documentation
and icon files in the Documentation File and Icon File fields. (To browse
to a file, click in the field. Then click the displayed button.)
10. Click Next. A summary of the new framework is shown.

Figure 88 Framework Wizard Summary Page

11. If you are satisfied with the framework specification, click Finish.
Otherwise, go back and change your settings.
When the Framework Wizard is finished, a folder with the same name
as the new framework, containing the specified files, will be created in
the \Framework\Frameworks folder. The new framework is now
available for creating new models.

Rational Rose 2000, Using Rose 197


Chapter 12 Framework Wizard Add-In

Changing or Deleting a Framework


To change the contents of a framework model, its icon, its description,
or the initial diagram to be opened, update the appropriate file in the
framework’s folder.
To delete a framework, delete its folder in the
\Framework\Frameworks folder.

198 Rational Rose 2000, Using Rose


Chapter 13

Type Library Importer

The Type Library Importer allows you to import a type library of a COM
component into the model, by dragging the COM component from the
Windows Explorer and drop it in Rational Rose. Or, you can use the
Tools > COM > Import Type Library command.
You can control several aspects of how type libraries are imported into
the model. For example, you can control:
■ What should happen with existing type libraries when importing
new versions
■ The name and location of new type libraries in the model
■ The name and contents of the overview diagrams that are created
when importing type libraries
For further information, see the Customizing the Type Library Importer
section later in this chapter.
Note: Importing a component is not the same as reverse engineering a
component into the model. Imported components are still external to the
system, because you import only the type library of the components,
whereas reverse engineering a component means that a model of the
component’s source code is added to the model.

Rational Rose 2000, Using Rose 199


Chapter 13 Type Library Importer

What Is a Type Library?


A type library contains a description of a COM (component object
model) component as viewed from the outside. The description
includes the coclasses, interface items, dispinterfaces, properties
(called attributes in UML), methods (called operations in UML), data
types, etc. of the component. Type library information is needed to
provide a language-neutral description of the interfaces and data types
that a COM component exposes.
This chapter does not explain the different kinds of type library items—
coclasses, interfaces, dispinterfaces, etc. For detailed information
about COM components and type libraries, refer to:
■ Don Box, Essential COM, Addison-Wesley Pub Co, ISBN
0201634465
■ http://msdn.microsoft.com/library—for example the Inside OLE
section in the Books section.

Why Would I Want to Import Type Libraries into the Model?


By importing type libraries into the model, you can show how classes
in the model use and depend upon classes in other components,
regardless of their implementation language. For example, you can:
■ Reuse COM components—that is, to show how the classes in the
model instantiate, use, and communicate with the items in a COM
component.
■ Show how classes in the model implement (or realize) the interface
items of a COM component.
■ Show dependencies between components.
■ Use the data types defined by a COM component when specifying
attributes and operations on the classes in the model.

What COM Components Can Be Imported into the Model?


The following file types can be imported into a Rational Rose model:
■ Dynamic Link Libraries (.dll)
■ Executables (.exe)
■ ActiveX Components (.ocx)

200 Rational Rose 2000, Using Rose


How Is a Type Library Presented?

■ Object Libraries (.olb)


■ Type Libraries (.tlb)
The file must contain valid type information. If you drop a file without
type information on an element in the browser, Rational Rose treats it
as any file and attaches the dropped file to the model element that you
drop it on. When you drop the file in Rational Rose, the cursor indicates
whether the file will be imported or attached to a model element. A
cursor with:
■ a icon means that Rational Rose imports the file
■ a icon means that the file is attached to the model element that
you drop it on

How Is a Type Library Presented?


In Rational Rose, an imported type library is represented as a
component in the component view and a logical package containing the
type library items. In your implementation environment, a type library
is presented differently in different implementation language
environments.

A Type Library in Rational Rose


The Type Library Importer creates a component, such as Scripting Ver
1.0 (Microsoft Scripting Runtime) in Figure 89, in the component view
for an imported type library.

Figure 89 The Component View of the Microsoft Scripting Runtime


Type Library

Rational Rose 2000, Using Rose 201


Chapter 13 Type Library Importer

The Component Overview Diagram

The component is automatically inserted into a type library overview


diagram in the component view. For example, the overview diagram in
Figure 90 shows that two type libraries, Scripting and stdole, have
been imported into this model and that the Scripting type library
depends upon the stdole type library.

Figure 90 The Component Overview Diagram for a Model

The Logical View of a Type Library

The logical view contains a package for the imported COM component,
such as Scripting Ver 1.0 (Microsoft Scripting Runtime) in Figure 91.

Figure 91 The Logical View of the Microsoft Scripting Runtime Type


Library

202 Rational Rose 2000, Using Rose


How Is a Type Library Presented?

Type Library Items

The logical package contains the type library items that are defined by
the type information of the imported COM component—coclasses,
interfaces, dispinterfaces, etc.
Each item in the type library is represented by a class, such as the
coclass “FileSystemObject” in Figure 91. The stereotype of the type
library’s classes in the model indicates the kind of project item—
coclass, interface, enum, type, module, struct, and union (see the COM
Stereotypes section below). As you can see in Figure 91, coclasses have
their own icon in the browser: .
The “kind” model property on an interface class indicates whether the
class corresponds to an interface or a dispinterface in COM.
Note: If the type library was imported using a quick import, the Type
Library Importer does not create any class members (attributes and
operations) on the imported items. If you chose a full import, the class
members are created. You can later import the class members for a type
library item, see the Adding Class Members to a Quick Import Type
Library section in this chapter.

The Type Library Overview Diagram

An overview diagram is created in the logical view, which shows the


contents of the imported type library. Figure 92 shows the overview
diagram for the Microsoft Scripting Runtime type library.
As you can see, coclasses, such as Encoder in Figure 92, are green in
type library overview diagrams.

Rational Rose 2000, Using Rose 203


Chapter 13 Type Library Importer

Figure 92 The Logical Overview Diagram of the Microsoft Scripting


Runtime Type Library

Hidden Items

If the Show hidden items option in the COM Properties dialog box is cleared
when a type library is imported, all hidden items and items with names
beginning with “_” are placed in a separate logical package called
“Hidden”. Those items are not displayed on the overview diagram. The
Microsoft Scripting Runtime type library in Figure 91 and Figure 92
was imported with the Show hidden items option cleared.
For more information, see the Hiding Type Library Items section in this
chapter.

Referenced Type Libraries

Any referenced type libraries are automatically imported. When


importing a type library item, for example A, all items that A refers to
must exist in the model. If the referenced items did not exist in the
model before, the Type Library Importer automatically imports the type
libraries of the corresponding COM components and adds dependency
relationships between them. For example, the stdole type library in
Figure 90 was automatically imported when the Scripting type library
was imported, because Scripting refers to the stdole type library.

204 Rational Rose 2000, Using Rose


How Is a Type Library Presented?

Referenced type libraries are imported using a quick import. Also, type
library items that are referenced by the current type library, such as
IDispatch in Figure 92, are gray in the type library’s overview diagram.

COM Stereotypes

The Type Library Importer uses the stereotypes in Table 17 for the
model elements that represent a type library in the model.
Table 17 COM Stereotypes

Stereotype: Meaning:

Components

COM The Type Library Importer assigns the stereotype and


language “COM” to the component representing an imported
type library.

Classes

coclass Represents an enum type definition in a type library. The


class members of the enum in the type library become
attributes with initial values on the class in the model.

enum Represents an enum type definition in a type library. The


class members of the enum in the type library become
attributes with initial values on the class in the model.

interface Represents an interface or dispinterface in a type library.


The “kind” model property on the class in Rational Rose
indicates whether the class is an interface or a
dispinterface. Type library interfaces are always abstract—
that is, the Abstract box in the interface’s Class Specification
is checked.

module Represents a module in a type library.

struct Represents a struct type definition in a type library. The


class members of the struct in the type library become typed
attributes on the class in the model.

union Represents a union type definition in a type library. The


class members of the union in the type library become typed
attributes on the class in the model.

Rational Rose 2000, Using Rose 205


Chapter 13 Type Library Importer

Stereotype: Meaning:

Operations

propget Corresponds to a property-accessor function on an interface


or dispinterface.

propput Corresponds to a property-setting function on an interface


or dispinterface.

propputref Corresponds to a property-setting function that uses a


reference instead of a value.

Realize
relationship

none Represents any realize relationship between type library


items.

source Indicates that the realized interface contains the coclass’


event procedures.

default Indicates that the realized interface is the default interface


of the coclass.

Dependency
relationship

imports Indicates that the supplier COM component was


automatically imported when the client component was
imported, because the supplier component is referenced by
the client component.

A Type Library in the OLE Viewer in Visual Studio


The contents of a type library as shown in the OLE Viewer correspond
to how Rational Rose presents an imported type library. Figure 94
shows how the OLE Viewer in Visual Studio presents the Microsoft
ActiveX Data Objects type library, MSADO15.dll. All the type library
items displayed by the OLE Viewer can be found in the model after
importing the type library.

206 Rational Rose 2000, Using Rose


How Is a Type Library Presented?

Figure 93 The OLE Viewer in Visual Studio

A Type Library in the Object Browser in Visual Basic


Figure 94 shows how the Object Browser in Visual Basic presents the
Microsoft ActiveX Data Objects type library, MSADO15.dll. As you can
see, the Object Browser in Visual Basic shows only those type library
items that are relevant in Visual Basic. For example, it does not list the
default interfaces of the coclasses, because Visual Basic assumes the
default interface when referring to a coclass.

Rational Rose 2000, Using Rose 207


Chapter 13 Type Library Importer

Figure 94 The Object Browser in Visual Basic

As Rational Rose supports many different programming languages, all


items in an imported type library are shown in the model. However, by
clearing the Show hidden items option, the top level of the packages of the
type libraries that you import, as well as their overview diagrams, give
the same view of the libraries as the Object Browser in Visual Basic.
For more information, see the Hiding Type Library Items section in this
chapter.

Importing a Type Library Into the Model


The Type Library Importer in Rational Rose allows you to import a type
library of a COM component into the model. By doing that, you can
show how classes in the model use and depend upon classes in other
components.
If you want to change the default behavior of the Type Library Importer,
the Tools > COM > Properties dialog box allows you to control how to import
type libraries. For more information, see the Customizing the Type
Library Importer section in this chapter.

208 Rational Rose 2000, Using Rose


Importing a New Version of an Existing Type Library

To import a type library into the model:

1. If a type library is to be used by Visual Basic classes only, you may


want to show only the type information that is relevant for Visual
Basic classes. See the Hiding Type Library Items section in this
chapter.
2. Drag the file—DLL, EXE, OCX, OLB, or TLB—from the Windows
Explorer and drop it in the browser or in a diagram. (The drop
target is not important, because the type library is created in the
packages defined by the Default package options in the COM Properties
dialog box.)
Note: If the Rational Rose application window is hidden or
minimized, point to the Rational Rose icon in the Windows task bar
before dropping the file, which brings the application to the front.
Instead of dragging and dropping the file, you can click Tools > COM >
Import Type Library and select the appropriate file.
3. On the displayed menu, select whether to import the full
component (Full Import), including all operations and attributes of
the type library items, or to perform a Quick Import which excludes
the members.
Note: You can later import the members of a quickly imported type
library item, see the Adding Class Members to a Quick Import Type
Library section in this chapter.
4. The following now happens:
❑ If the selected COM component contains all the necessary type
information, the Type Library Importer creates a representation
of the type library in the model.
❑ If a dragged and dropped COM component does not contain
valid type information, and if you have dropped the component
on an element in the browser, Rational Rose attaches the
dropped file to that element if possible. That is, if the cursor
turns into an arrow with a icon, Rational Rose will attach and
not import the file.

Importing a New Version of an Existing Type Library


To import a new version of a type library that already exists in the
model, right-click on the component that represents the imported type
library and click Upgrade to Latest Version.

Rational Rose 2000, Using Rose 209


Chapter 13 Type Library Importer

Hiding Type Library Items


When importing a type library, the created type library in the model is
represented differently depending on the Show hidden items option in the
Tools > COM > Properties dialog box.

Show Hidden Items Selected


If the Show hidden items option is selected when importing a type library,
all type library items, coclasses, dispinterfaces, interfaces, etc. are
shown on the type library’s overview diagram. Also, the type library
items are inserted directly under the type libraries package in the
browser.
Figure 95 shows how the Microsoft Scripting Runtime component,
scrrun.dll, is presented when imported with the Show hidden items option
is selected. This view is recommended when developing clients in other
languages than Visual Basic.

Figure 95 Type Library with Show Hidden Items Option Selected

210 Rational Rose 2000, Using Rose


Hiding Type Library Items

Show Hidden Items Cleared


If the Show hidden items option is cleared when importing scrrun.dll, no
hidden type library items are shown on the type library’s overview
diagram. Also, the hidden type library items are inserted into a
separate package called “Hidden” in the type library’s package in the
browser.
Figure 96 shows how the Microsoft Scripting Runtime component,
scrrun.dll, is presented when imported with the Show hidden items option
is cleared.

Figure 96 Type Library with Show Hidden Items Option Cleared

This means that with this view, only the type information that is
relevant for Visual Basic clients are shown on the type libraries
overview diagram, and all hidden type library items are inserted into a
separate package called “Hidden”. Thus, this view is recommended
when developing Visual Basic clients, because it corresponds to the
view that is shown by the Object Browser in Visual Basic (see
Figure 94).

Rational Rose 2000, Using Rose 211


Chapter 13 Type Library Importer

Using an Imported Type Library


By importing type libraries into the model, you are able to show how
classes in the model use and depend upon classes in other
components, regardless of their implementation language. The
application you are modeling can use a type library in several ways, for
example:
■ Classes can use the data types defined by a type library
■ Classes in the model can implement the interface of a COM
component
■ A COM component can be reused by the application
How to use a type library differs between different programming
languages. For further information, refer to the Rational Rose
documentation of each language integration.

Adding Class Members to a Quick Import Type Library


If a type library was imported using a quick import, the Type Library
Importer did not create any class members (attributes and operations)
on the imported items. You can later import the class members of a
type library item by doing a full import of that item.

To add class members to a type library:

1. In the browser or in a diagram, right-click on a(n):


❑ interface to import its class members into the model
❑ coclass to import the class members of its interfaces into the
model
❑ COM component to import the class members of all the items in
that type library
2. Click Full Import on the displayed menu.
Note: It may take several minutes for Rational Rose to perform a full
import of an entire COM component. If you do not want to import the
entire type library, perform a full import of only those type library items
that you are using.

212 Rational Rose 2000, Using Rose


Customizing the Type Library Importer

Customizing the Type Library Importer


In the Tools > COM > Properties dialog box, you can control several aspects
of how type libraries are imported into the model. For example, you can
control the following:
■ What should happen with existing type libraries when importing
new versions
■ The name and location of new type libraries in the model
■ The name, location, and contents of the overview diagrams that are
created when importing type libraries
To open the COM Properties dialog box, click Tools > COM > Properties:

Figure 97 The COM Properties Dialog Box

Note: Changing the settings in the COM Properties dialog box affects only
type libraries that are imported hereafter.

To replace existing type libraries when importing new versions:

Select the Upgrade older type libraries option in the COM Properties dialog box.
The next time you import a new version of a type library, the current
version is replaced by the new version. If this option is cleared when
you import a new version of a type library, the model will contain both
versions.

Rational Rose 2000, Using Rose 213


Chapter 13 Type Library Importer

To hide items that are defined as hidden or called _item :

See the Hiding Type Library Items section in this chapter.

To change the name of the logical packages where type libraries


are created:

In the Default package box under Logical view in the COM Properties dialog
box, type the name of the package including the path of any enclosing
packages. You can use the following variables in the package name:
■ $library — the name of the imported type library, which
corresponds to the library model property
■ $version — the version of the imported type library, which
corresponds to the version model property
■ $helpstring — a description of the type library, which corresponds
to the helpstring model property
For example, “COM/$library Ver $version ($helpstring)” means that
the following logical package is created for a new type library called
stdole:
Logical View
COM
stdole Ver 2.0 (OLE Automation)

To change the name of the component packages where type library


components are created:

In the Default package box under Component view in the COM Properties dialog
box, type the name of the package including the path of any enclosing
packages. You can use the same variables as above.
For example, “COM/$library Ver $version ($helpstring)” means that
the following component package is created for a new type library
called stdole:
Component View
COM
stdole Ver 2.0 (OLE Automation)

214 Rational Rose 2000, Using Rose


Customizing the Type Library Importer

To change the name and location of the diagrams on which type


libraries are displayed:

In the Overview diagram box under Logical view or Component view in the COM
Properties dialog box, type the name of the diagram including the path
of any enclosing packages. You can use the same variables as above in
the diagram name.
For example, the default value for the logical view is “COM/$library Ver
$version ($helpstring)/Overview of $library”, which means that the
Type Library Importer creates a diagram called “Overview of stdole Ver
2.0 (OLE Automation)” when you import a COM component called
stdole.
The default value for the component view is “COM/Overview of type
libraries”. This means that the Type Library Importer inserts all
imported type library components into the same diagram, which is
called “Overview of type libraries”.

Rational Rose 2000, Using Rose 215


Chapter 14

Stereotypes

Overview
A stereotype is a modeling element subclassification that has been
given a more specific meaning. Stereotypes can be applied to:
■ Packages
■ Components
■ Classes
■ Use Cases
■ Attributes and Operations
■ Association, Generalization, and Dependency Relationships
■ Processors, Devices, and Connections
■ Activities
■ State
A stereotype can be depicted by either a name or by an icon.

Benefits to Using Stereotypes


A stereotype allows you to provide additional distinctions in your model
that are not explicitly supported by the UML. The use of stereotypes:
■ Allows for customization of your development process
■ Provides mnemonic help and visualization aids
■ Allows you to make presentations with more pizzazz

Rational Rose 2000, Using Rose 217


Chapter 14 Stereotypes

User-Defined Stereotypes
Some stereotypes are predefined, but you can also define your own to
add new kinds of modeling types, as the class stereotypes in Figure 98.
User-defined stereotypes are defined in a stereotype configuration file.
For each stereotype, you can customize icons to be displayed in
diagrams, in the browser, and in the toolbox.

Figure 98 Example of a Diagram with User-Defined Stereotypes

Rational Rose offers ten stereotype icons that you can use when
modeling a business:
■ Business Use Case
■ Use-Case Realization
■ Boundary Class
■ Business Actor
■ Business Entity
■ Business Worker
■ Entity Class
■ Control Class
■ Business Use Case Realization
■ Organization Unit Package
For more information on these icons, refer to the Rational Unified
Process (RUP).

218 Rational Rose 2000, Using Rose


Viewing Stereotypes

Viewing Stereotypes
You can control how stereotypes are displayed. The settings are found
on the Diagram tab and the Browser tab, located in the Options dialog box
under the Tools menu.

Diagram Tab

Stereotype
Setting

Stereotype
Settings

Figure 99 Options Dialog Box Diagram Tab

The following selections are applied to new model elements are added
to the diagrams. To make changes to existing model elements use the
shortcut menu.

Compartments Show Stereotypes

This option allows you to control the display of stereotype names for
operations and attributes of new classes in the class compartments.

Stereotype Display None, Label, Decoration, Icon

These options allow you to control the display of stereotypes (except for
relationships) in diagrams. The selection is applied to new model
elements that are added to diagrams.

Rational Rose 2000, Using Rose 219


Chapter 14 Stereotypes

Selecting Label, makes the name of the stereotype appear inside angled
brackets, << >>. Decorating displays a graphic marker such as
highlighting an icon or tool. Selecting None means the name is not
displayed, while selecting Icon means the icon created for that
stereotype is displayed.

Stereotype Display Show labels on relations and associations

This option allows you to control the display of stereotype labels on new
relationships in diagrams. If enabled, the name of the stereotypes will
appear inside angle brackets, << >>.

Browser Tab

Stereotype
Settings

Figure 100 Options Dialog Box Browser Tab

The changes made on the Browser tab are reflected in the browser.

Show stereotype names

This option allows you to control the display of stereotype names of


model elements in the browser.

220 Rational Rose 2000, Using Rose


Creating Stereotypes

Hide stereotype name if there is an icon for it

Select this option to display stereotype icons, but not stereotype


names, of model elements in the browser. This option is only relevant
for stereotypes that have an icon.

Creating Stereotypes

Creating a New Stereotype for the Current Model


You can create a new stereotype by typing a new name in the Stereotype
field of a model element’s specification. The new stereotype will then be
available in the Stereotype field for all model elements of that type (which
are assigned the same language), in the current model.
If you want the stereotype to be available in all Rose models, follow the
steps below. If you already have a stereotype configuration file, skip to
the section titled Creating a New Stereotype for All Rose Models.

Creating a New Stereotype Configuration File


The stereotypes in Rational Rose must be defined in a stereotype
configuration file. Rational Rose is delivered with a default stereotype
configuration file, called DefaultStereotypes.ini. If possible, add your
stereotypes to that file. If you do not want to use that file, follow these
steps to create a new stereotype configuration file:
1. Close Rational Rose.
2. Create a text file (called, for example, MyStereotypes.ini) using
Notepad or another text editor, and save it in the Rose installation
folder.
3. Edit the new stereotype configuration file. For information on how
to create a new stereotype and add it to a stereotype configuration
file, please refer to the Creating a New Stereotype section.
4. Run the Windows Registry Editor (regedit.exe) by selecting Run on
the Start menu. Type “regedit” and click OK.
5. Locate and select the section entitled
[HKEY_LOCAL_MACHINE\SOFTWARE\Rational
Software\RoseStereotypeCfgFiles] in the registry list.

Rational Rose 2000, Using Rose 221


Chapter 14 Stereotypes

6. Click Edit > New and click String Value. Give the new registry key the
name “file#”, where # is the next consecutive number (1, 2, or 3,
etc.).
7. Double-click the new key, and enter the name of your
configuration file (for example, MyStereotypes.ini).
8. Close the registry. Next time you open a model in Rational Rose,
the stereotypes defined in your new stereotype configuration file
will be available in the model.

Creating a New Stereotype for All Rose Models


To create a new stereotype and make it available in all models in Rose:
1. Close Rational Rose.
2. Optionally, create icons for the stereotype to be used in diagrams,
lists, and diagram toolboxes. Please refer to the Creating Stereotype
Icons section later in this chapter.
3. Open the default stereotype configuration file,
DefaultStereotypes.ini.
4. In the stereotype configuration file, add a line for the new
stereotype in the section called [Stereotyped Items]. For example, to
add the class stereotype Controller to an existing configuration file,
add a corresponding line as follows:
[Stereotyped Items]
Class:Model
Class:View
Class:Controller
5. Create a section for the new stereotype, named exactly as the line
you added in the [Stereotyped Items] section, for example:
[Class:Controller]
Item=Class
Stereotype=Controller
6. If you have created a diagram icon for the stereotype, specify the
name of that file (Metafile). Note that you can use “&” instead of the
folder of the stereotype configuration file. For example:
Metafile=&\MyStereotypeIcons\controller.emf

222 Rational Rose 2000, Using Rose


Creating Stereotypes

7. If you want to create a diagram toolbox button for this stereotype,


specify the name of the file where you created the corresponding
small toolbox icon (SmallPaletteImages) and the location of the icon
in that file (SmallPaletteIndex ). You can also specify the name of
the file where the corresponding large toolbox icon is defined
(MediumPaletteImages) and the location of the icon in that file
(MediumPaletteIndex). For example:
SmallPaletteImages=&\MyStereotypeIcons\
small_palette_icons.bmp
SmallPaletteIndex=3
MediumPaletteImages=&\MyStereotypeIcons\
medium_palette_icons.bmp
MediumPaletteIndex=3
8. If you want to graphically display this stereotype in specification
lists or in the browser, specify the name of the file where you
created its list icon (ListImages) and the location of the icon in that
file (ListIndex). For example:
ListImages=&\MyStereotypeIcons\list_icons.bmp
ListIndex=2
9. Add any other setting needed to define the new stereotype. For a
list of all available settings, information on the meaning of each
setting, the possible values, and the default values, please refer to
the “Stereotype Configuration File” topic in the online help. Note,
however, that you only have to include settings for which you want
to give other values than their default values.
10. Save your changes to the stereotype configuration file.
11. Run Rational Rose. View the log window to make sure there were
no problems loading your icons.
12. If you created a diagram toolbox icon for the new stereotype, and
want to add it as a button on a diagram toolbox, please refer to the
Adding Stereotypes to the Diagram Toolbox section later in this
chapter.
The new stereotype is now available in Rational Rose. For information
on how to control the display of the new stereotype in diagrams and in
the browser, please refer to the Viewing Stereotypes section earlier in
this chapter.

Rational Rose 2000, Using Rose 223


Chapter 14 Stereotypes

Creating Stereotype Icons


For each stereotype, four different icons may be supplied:
■ A diagram icon (to customize the appearance of model elements
with this stereotype in diagrams).
■ A small and a large diagram toolbox icon (to be able to add a button
for this stereotype to the diagram toolbox). Two different sizes
correspond to the Use Large Buttons option on the Toolbars tab of the
Options dialog box.
■ A list view icon (to graphically display the stereotype for model
elements in specification lists and in the browser).

Creating a Diagram Icon


Diagram icons are “symbols” or “elements” that can be placed on a
diagram from the browser, toolbar, or menu. Diagram icons have to be
created in Windows Metafile (.wmf) or Enhanced Metafile (.emf) format.
You can download drawing packages that support these formats at
various shareware sites on the Internet. Enhanced Metafiles are
recommended if possible. Diagram toolbox and list view icons must be
created in bitmap (.bmp) format.
Note: Note: If you create a diagram icon, for example, you will most
likely want to create the other three corresponding icons: a list view icon,
a small toolbar icon, and a large toolbar icon.

To create a diagram icon:

1. Using a vector based (as opposed to bitmap) drawing application,


draw your icon in the size you want it to appear in Rational Rose. It
is not recommended that you use a drawing application that forces
the icon to fit a certain area, such as a page as with PowerPoint.
2. Consider the following: Make sure that the scaling factor is set to
100% when deciding on the size of the icon. Use colors if you like. If
you want the name of the model element to appear within the
stereotype icon, leave some blank space for it.
3. Select the icon and export it in either the Windows Metafile (.wmf)
format or the Enhanced Metafile (.emf) format. If you use
CorelDraw, make sure the Include header option is checked if you
save your selection as a Windows Metafile.

224 Rational Rose 2000, Using Rose


Creating Stereotypes

Creating Diagram Toolbox and List View Icons


Diagram toolbox icons and list view icons (icons that appear in the
browser) are created in bitmap (.bmp) format and Rational Rose only
supports bitmap files saved in the 256 color bitmap scheme. You can
create one bitmap file containing several icons, arranged horizontally
side by side. Note that the SmallPaletteIndex setting in the
configuration file of a stereotype specifies the diagram toolbox icon that
belongs to a specific stereotype. The ListIndex setting specifies the list
icon that belongs to a specific stereotype. Diagram icons can only be
created in Windows Metafile (.wmf) or Enhanced Metafile (.emf) format.
Note: If you create a list view icon, for example, you will most likely
want to create the other three corresponding icons: a diagram icon, a
small toolbar icon, and a large toolbar icon.

To create a new icon:

1. Create or open a bitmap file using a program such as Microsoft


Paint or the bitmap editor in Microsoft Visual Studio.
Note: If you are adding several icons to the same bitmap file in
Microsoft Visual Studio, use the grid setting in the Image menu to help
you see the borders of each icon.
2. Create an icon of the following size and background color:
❑ Small diagram toolbox icon - 15 pixels high and 16 pixels wide,
using a gray background (which is RGB = 192, 192, 192 in
Rational Rose).
❑ Large diagram toolbox icon - 24 pixels high and 24 pixels wide,
using a gray background (which is RGB = 192, 192, 192 in
Rational Rose).
❑ List view icon - 16 pixels high and 16 pixels wide, using a white
background.
3. Save the icon as a 256 color bitmap file (.bmp). To save the color
setting in Microsoft Paint, select 256 color bitmap from the Save as
type menu in the Save as dialog box.
Note: Some of your icon colors may not show up precisely because
the color palette used by the toolbars is limited.

Rational Rose 2000, Using Rose 225


Chapter 14 Stereotypes

Adding Stereotypes to the Diagram Toolbox


To make a stereotype available as a button on a diagram toolbox:
1. Create a stereotype and a corresponding diagram toolbox icon. For
information on how to do that, please refer to the Creating a New
Stereotype section earlier in this chapter.
2. Click Tools > Options, and go to the Toolbars tab. Under Customize
Toolbars, click on the diagram type for which you want to change the
toolbox.
or,
In an open diagram, right-click in the diagram toolbox and select
Customize.
3. The Customize Toolbars dialog box is displayed. The leftmost column
provides the list of available icons. Select the icon you want to
appear on the diagram toolbox and click Add.

226 Rational Rose 2000, Using Rose


Chapter 15

Data Definition Language (DDL)


Generation

The gap between object technology and relational databases is closed


by providing a mapping interface to relational databases through
generation of persistent classes to Structured Query Language (SQL)
and Data Definition Language (DDL).
Unless otherwise stated, all comments made about SQL apply to the
baseline of the SQL 89 standard (ANSI X3H2-89-151/ ISO DBL CAN-
3a), commonly referred to as SQL2.

Overview
There are traditionally two different approaches to relational database
design. The first is to identify all the attributes in the problem and
place them together to create and preserve the stability of the
attributes. This follows a series of rules known as normalization. The
other approach is to identify the entities that exist in the problem. The
entities are explored and refined in terms of attributes and the
relationships between them, in a process referred to as Entity-
Relationship modeling. This process also employs the rules of
normalization.
Object modeling is an evolutionary process that incorporates entity
design. This allows the ability to perform object modeling and produce
as a by-product, a data model or schema. Understanding of the
concepts of entity design and normalization are necessary for this
chapter discussion.

Rational Rose 2000, Using Rose 227


Chapter 15 Data Definition Language (DDL) Generation

Object Orientation with Databases


Object models focus upon the structure and behavior of objects, and
their relationships and collaborations among objects. Object models
are an effective way of communicating with domain experts and users
to reach an understanding of the problem. From this basis of
understanding, you can derive a correct database design by
understanding the mapping of objects to tables, and the relation of the
generated data model to the overlying three-schema architecture of
relational database design.

DDL Extended Three Schema Model


The three-schema architecture is the standard architecture for data
modeling, first proposed by the ANSI/SPARC committee on databases.
The concept is that the design consists of three layers: external,
internal, and conceptual. The external level is the one closest to you,
concerned with the global overall application and how you interact with
these data. The internal level is the closest to the physical storage,
occasionally referred to as the physical view. The conceptual level is the
mapping between these two layers. It is expressed in terms of
conceptual DDL, (DAT90). The conceptual level is primarily used to
express relational databases. It is important to remember that the real
power of object modeling and mapping is its translation into a good
conceptual data model.

Use of Object Identifiers


Part of the object paradigm is that objects are unique by existence. No
property that describes the state or structure of the object is needed to
identify the object. However, if you want to identify an object you can
either assign a primary key or use system-generated identifiers,
sometimes referred to as surrogate identifiers.

228 Rational Rose 2000, Using Rose


Overview

Logical Views
Logical views are used to model the static relationships in a domain.
The pertinent elements of the logical view are:
■ Packages
■ Classes
■ Attributes
■ Associations
■ Inheritance

Packages
A package is a collection of classes that are strongly cohesive within the
collection and loosely coupled to classes outside of the collection. Each
package represents a chunk of the logical architecture of the system.
Packages can map to schema, but no limitation is given to the use of
categories. The software will generate all selected classes or all classes
that are marked as persistent. The suggestion is to logically place
persistent classes into a category, but this is not required nor enforced.
The primary means of mapping to DDL is the class.

Classes
A class maps to a table. There are mapping schemes that map a class
to tables or tables to a single class, but these deal with internal or
physical schema design and denormalization. The mapping to Rational
Rose does not currently support these options. A class must be marked
as persistent in order to generate DDL.

Rational Rose 2000, Using Rose 229


Chapter 15 Data Definition Language (DDL) Generation

A class contains attributes and operations. Currently, only maps to


attributes are supported. The following is an example of the base
generation of a class in which the primary key is not identified but
system generated. The generated key is created by the table name
concatenated with the property.

cities
place : string
address : string

CREATE TABLE CITIES (


PLACE VARCHAR(50),
ADDRESS VARCHAR(70),
CITIES_ID NUMBER(5) PRIMARY KEY);

Attributes
Attributes map to columns in the resultant table. The column
definition in DDL is added through the use of the DDL attributes
properties:

Figure 101 Options Specification DDL Tab

230 Rational Rose 2000, Using Rose


Overview

ColumnType

The attribute type is usually part of the external schema, referenced in


the language that is being generated (C++, VB, etc.). This property
maps to a fundamental data type (such as CHAR, VARCHAR, etc.).

Length

Provides an optional length for the attribute. In CHAR and VARCHAR


data types, length is expressed as a scalar value, for example, 20 yields
CHAR(20). For NUMBER or numeric types, this can be expressed as
<length>, <precision>, that is 5,2 would yield NUMBER(5,2).

NullsOK

Boolean value to mark attribute as Nullable. If it is set to True, the


attribute will be required to have a value:
NAME VARCHAR(40) NOT NULL

PrimaryKey

Marks the attribute as a primary key, or part of a primary key. If no


attributes are set, a system generated key will be added to the table
definition. If more than one primary key attribute is identified, a
concatenated primary key is generated.

Unique

Marks the attribute as having unique values. If it is set, it will force


uniqueness on the attribute:
NAME VARCHAR(40) UNIQUE

CompositeUnique

Allows one concatenated unique key per table. If attributes in the class
are set, a single concatenated key will be produced:
UNIQUE(NAME,ADDRESS)

CheckConstraint

Allows one constraint check per attribute. The value should be the
constraint.

Rational Rose 2000, Using Rose 231


Chapter 15 Data Definition Language (DDL) Generation

Association Relationships
An association is a bi-directional class relationship that denotes a
semantic dependency between two classes. If an association exists
between two persistent classes, a relationship will exist between the
resultant tables generated. All associations have several features that
can control DDL generation.
These features provide the information for the creation of relationships
between tables through referential integrity constraints, and the
addition of indexes to the tables:

Association name

The association name is used as the name of the relationship if no


primary key is named as the target relation table.

Multiplicity and Navigability

Multiplicity is commonly used as the determining factor for the


creation of relations between tables. However, you can determine
relationships through navigability. If navigability is set for the direction
of the association, a relation is created through a foreign key, and
between the resultant tables—regardless of multiplicity.

Aggregation

Aggregation (or containment) will modify the relationship by adding a


DELETE CASCADE constraint to the Foreign key in databases that
provide this capability.

232 Rational Rose 2000, Using Rose


Overview

The following DDL is generated for the Person-Cities tables and the
Company-Department tables, one showing a navigable association and
the other an aggregation:
CREATE TABLE T_Person(
name CHAR(20) NOT NULL,
paddress VARCHAR() UNIQUE,
phone VARCHAR() NOT NULL UNIQUE,
place VARCHAR(),
address VARCHAR(),
FOREIGN KEY (place) REFERENCES T_cities,
FOREIGN KEY (address) REFERENCES T_cities
PRIMARY KEY(name,paddress));

CREATE TABLE T_cities(


place VARCHAR(),
address VARCHAR(),
PRIMARY KEY(place,address));

CREATE TABLE T_Company(


CUSIP VARCHAR()
deptname VARCHAR(),
(FOREIGN KEY (deptname) REEFERENCES
T_department ON DELETE CASCADE,)
CompanyId NUMBER(5),
PRIMARY KEY(CompanyId));

Keys

Keys or qualifiers create indices for the resultant table. Each key is
generated as an index for the affected table. Multiple keys will result in
a generation of a concatenated index for the cities. The following
example is generated for the cities table:
CREATE INDEX cities_1 ON T_cities(place,address);

CREATE INDEX cities_2 ON T_cities(place);

Rational Rose 2000, Using Rose 233


Chapter 15 Data Definition Language (DDL) Generation

Link Classes

Link classes map to associative entities—a method which resolves


many-to-many relations between tables. To create an associative
entity, place a link class between the two classes that have the many-
to-many relationship. The name of the class will be the name of the
resultant table. This table will have any additional attributes that are
defined in the class, and will have as its’ primary key the concatenated
keys of the two dependent tables.
The following resultant DDL is generated for the team Link Class:
CREATE TABLE T_team(
team_name VARCHAR(),
name CHAR(20) NOT NULL,
paddress VARCHAR() UNIQUE,
FOREIGN KEY (name) REFERENCES T_employee ON DELETE
CASCADE,
FOREIGN KEY (paddress) REFERENCES T_employee ON DELETE
CASCADE,
deptname VARCHAR(),
FOREIGN KEY (deptname) REFERENCES T_departmentON DELETE
CASCADE,
PRIMARY KEY(name,paddress,deptname)
);

Inheritance

Relational databases do not support the concept of inheritance as in


programming languages, however, mapping of inheritance hierarchies
to database schema is supported. Each class is created as a table, with
each subclass being a subset of the top table in the hierarchy. This
means each subclass table will share the primary key of the parent.

234 Rational Rose 2000, Using Rose


Overview

Inheritance is then mapped through a join view that is created for each
subclass table. The following DDL is generated for the example of
Person-Employee-Manager, and the resultant view generated for
manager:
CREATE TABLE T_Person(
name CHAR(20) NOT NULL,
paddress VARCHAR() UNIQUE,
phone VARCHAR() NOT NULL UNIQUE,
place VARCHAR(),
address VARCHAR(),
FOREIGN KEY (place) REFERENCES T_cities,
FOREIGN KEY (address) REFERENCES T_cities,
PRIMARY KEY(name,paddress));

CREATE TABLE T_employee(


emp_id VARCHAR(),
deptname VARCHAR(),
FOREIGN KEY (deptname) REFERENCES T_department,
name CHAR(20) NOT NULL,
paddress VARCHAR() UNIQUE,
PRIMARY KEY(name,paddress),
FOREIGN KEY (name,paddress) REFERENCES T_Person ON
DELETE CASCADE
);
CREATE TABLE T_manager(
title VARCHAR(),
name CHAR(20) NOT NULL,
paddress VARCHAR() UNIQUE,
PRIMARY KEY(name,paddress),
FOREIGN KEY (name,paddress) REFERENCES T_Person ON
DELETE CASCADE
);
CREATE VIEW manager_V(
title,
emp_id,
deptname,
name,
paddress,
phone,
place,
address)
AS SELECT
T_manager.title,
T_employee.emp_id,
T_department.deptname,

Rational Rose 2000, Using Rose 235


Chapter 15 Data Definition Language (DDL) Generation

T_Person.name,
T_Person.paddress,
T_Person.phone,
T_cities.place,
T_cities.address
FROM T_manager,T_employee,T_Person
WHERE T_manager.name=T_employee.name
AND T_manager.paddress=T_employee.paddress
AND T_employee.name=T_Person.name
AND T_employee.paddress=T_Person.paddress;
Note: A limitation is placed on this generation by Rational Rose. The top
parent class of the hierarchy must specify its primary key. It cannot use
a system generated key.

Controlling DDL Generation


The following project properties help to tailor DDL generation:

DataBase
Sets the default targeted database. Current supplied databases are
Oracle, SQLServer, Sybase, Watcom and ANSI standard DDL.

PrimaryKeyColumnKey
This is the extension that is concatenated to the class name to create
the primary key name if a primary key is supplied.

PrimaryKeyColumnType
This is the datatype used for generated primary keys.

ViewName
Provides an optional naming standard prefix that is concatenated for
all generated views. If blank, no prefix is added.

TableName
Provides an optional naming standard prefix that is concatenated for
each generated table. If blank, no prefix is added.

236 Rational Rose 2000, Using Rose


Overview

InheritSuffix
An additional optional view suffix that is added to the join views which
are produced for inheritance mapping.

DropClause
Boolean value that, if true, creates a DROP TABLE statement before
each CREATE TABLE statement.

DDLScriptFileName
The default script file name that will be created to contain the DDL
script.

Generating DDL
To generate the DDL, select the desired classes, click Tools > Generate DDL.
A dialog appears with the default database and script file name that are
set by the project properties. These can be overridden at this time.
The DDL is then generated to the specified file and will provide a
Generation Complete message upon successful completion. The
resultant DDL can then be imported into the database.

Rational Rose 2000, Using Rose 237


Chapter 16

Microsoft Repository Integration Add-In

Rational Rose allows you to exchange model information with other


modeling tools by providing an integration with the Microsoft
Repository and Visual Component Manager 98 (VCM)—the Repository
Add-In.
On the initiative of Microsoft, several modeling tool vendors are
providing support for exchanging model information through the
Microsoft Repository. Thus, those portions of models that are common
between various modeling tools and the UML tool information model in
the repository can easily be exchanged.
The Repository Add-In places three additional commands on the Tools
menu in Rational Rose: Publish to VCM, Export to Repository, and
Import from Repository. These commands apply to entire models, not
to single model elements. From within the VCM, you can also import a
single class or logical package of a published model into Rational Rose,
by using drag and drop.

The Differences Between Publish to VCM and Export to


Repository
The difference between the Publish to VCM and Export to Repository
commands is the type of the published/exported model. Export to
Repository uses the UML tool information model to store the model,
whereas Publish to VCM uses the VCM tool information model.

Rational Rose 2000, Using Rose 239


Chapter 16 Microsoft Repository Integration Add-In

The type of the published/exported model defines how much


information can be published/exported. The Publish to VCM command
covers the entire model file, including all views and diagrams. The
Export to Repository command applies only to classes, attributes,
operations, and a subset of the relationships of the logical view of the
model. Also, the Export to Repository command does not export any
diagrams.
Note: The Repository Add-In is only available on Windows. Also, in
order to use the repository commands, the Repository Add-In must be
active (see the Activating the Repository Add-In section below).

Activating the Repository Add-In


In order to use the Repository Add-In, the feature must be installed and
active. It is active if the repository commands are available on the Tools
menu in Rational Rose.
To activate the Repository Add-In:
1. Click Add-In Manager on the Add-In menu in Rational Rose.
2. Select the Repository option and click OK. If the option is not present,
the Repository Add-In is not installed.
To install the Repository Add-In:
1. Run the Rational Rose setup program.
2. Select a custom install, and select the Rose Repository Add-In
feature. If the feature is not present, the add-in is not available in
your Rational Rose edition.

Publishing a Model to Visual Component Manager


By publishing a model into the Visual Component Manager (VCM),
model information can be exchanged with another tool. To publish the
current open model to VCM:
1. Save the model.
2. Click Tools > Publish to VCM.
3. In the displayed dialog box, select the folder into which you want to
publish the current open Rational Rose model.

240 Rational Rose 2000, Using Rose


Exporting a Model to the Microsoft Repository

4. Give the published model a name to be used in VCM; for example,


the name of the model file.
5. Click Save.
The entire model is published. When Rational Rose is finished, the
published model can be imported from the repository by another
modeling tool.
Note: The Publish to VCM command requires that the repository
contains the VCM tool information model. If the repository does not
contain that information model, you must use the Export to Repository
command instead.

Exporting a Model to the Microsoft Repository


By exporting a model into the Microsoft Repository, model information
can be exchanged with another tool. To export the logical view of the
current open model to the Microsoft Repository:
1. Save the model.
2. Choose Export to Repository from the Tools menu.
3. In the displayed dialog box, select the folder into which you want to
publish the current open Rational Rose model.
4. Give the exported model a name to be used in the repository; for
example, the name of the model file.
5. Click Save.
When Rational Rose is finished, the exported model can be imported
from the Microsoft Repository by another modeling tool.
Note: Export to Repository command exports only a subset of the logical
view of the model, and that no diagrams are exported.

Importing a Model from the Microsoft Repository


The Microsoft Repository can be used to import a model that has been
published/exported from another tool. To import a model from
Microsoft Repository into an empty model:
1. Open a new empty model in Rational Rose.
2. Click Tools > Import from Repository. A dialog box is displayed.
3. Select the model you want to import and click Open.

Rational Rose 2000, Using Rose 241


Chapter 16 Microsoft Repository Integration Add-In

Rational Rose then imports the contents of the selected model into the
current open model. If the model has been published with the Publish
to VCM command, the entire model is imported. If the model has been
exported with the Export to Repository command, only the logical view,
and no diagrams, are imported.

Browsing a Published Model in Visual Component Manager


To browse a published model in the VCM:
1. Start the Microsoft VCM.
2. Open the folder where the published model is located.
3. Select the model you want to browse. A brief description of the
model is displayed in the lower frame.
4. To view the contents of the selected model, press the right mouse
button and click Browse Item Details. A hierarchical view of the logical
packages, associations, and classes is displayed in the lower-right
frame.

Figure 102 The Visual Component Manager

242 Rational Rose 2000, Using Rose


Importing Model Elements from Visual Component Manager

Importing Model Elements from Visual Component Manager


With the Import from Repository command in Rational Rose you can
import entire models, but from within the Visual Component Manager
(VCM) you can also import a single class or logical package of a
published model.
To import a class or logical package from VCM to a model:
1. In Rational Rose, open the model to which you want to import the
class or package.
2. Start the Microsoft Visual Component Manager, and open the
folder where the published model is located.
3. Select the model from which you want to import.
4. Press the right mouse button, and choose Browse Item Details from the
displayed menu. A hierarchical list showing the logical packages,
associations, and classes of the selected model is displayed in the
lower-right frame.
5. Expand the list to display the class or logical package you want to
import.
6. Drag the class or package from the list and drop it:
❑ on an open class diagram (except three-tiered diagrams) in
Rational Rose or
❑ on the appropriate logical package in the browser in Rational
Rose.
Rational Rose then imports the selected class or logical package into
the logical view of the current open model.

Rational Rose 2000, Using Rose 243


Chapter 17

Team Development

To support teams of analysts, architects, and software developers,


Rational Rose:
■ Allows team development of a shared model by supporting
decomposition of the model into versionable units, called controlled
units.
■ Permits model files and controlled units to be moved or copied
among workspaces by using the virtual path map mechanism.
■ Enables teams to manage their model in concert with other project
artifacts by integrating with standard version control systems.
Rational Rose provides built-in integrations with Rational
ClearCase and with SCC-compliant version control systems, such
as Microsoft Visual SourceSafe.
See the chapter on Version Control Add-Ins in this manual.
Also, you can integrate Rational Rose with any command-line
based version control system via user-supplied scripts that are
accessed by customizing the Rational Rose menus.
■ Provides a separate tool, called Model Integrator, to compare and
merge controlled units.
See chapter Model Integrator in this manual.
■ Integrates with the Microsoft Repository, to which a model in
Rational Rose can be published and later imported by another
modeling tool as a reusable asset.
See chapter Microsoft Repository Integration Add-In in this manual.
■ Enables teams to reuse large-scale design assets developed in
earlier modeling efforts by providing the possibility to add
frameworks in Rational Rose.

Rational Rose 2000, Using Rose 245


Chapter 17 Team Development

See chapter Framework Add-In in this manual.


The Team Development chapter provides an overview of the basic team
development concepts in Rational Rose, and how to set up and use
Rational Rose in a team. This chapter contains the following sections:
■ Controlled Units — Explains the basic team development concept,
controlled units
■ Setting Up a Multiuser Environment — Provides instructions on how
to set up Rational Rose for team development and how to integrate
Rational Rose with a version control system
■ Working with Controlled Units — Provides instructions on how to
organize a model in controlled units and how to work with them
■ Virtual Path Maps — Explains one of the basic team development
concept, virtual path maps, and how to define virtual paths
■ Using Rational Rose in a Team — Provides examples on how to use
Rational Rose in a team

Controlled Units
Rational Rose keeps a model in one or more files. These files are called
controlled units. Controlled units, or just units, are files into which
Rational Rose stores all or part of a model. They are the configuration
items that a team would place under version control. The controlled
units are created to define portions of the model upon which individual
developers can work. In a team environment, these controlled units are
shared within the team. Breaking up a model into controlled units
allows a project team to develop a model in parallel.

What Can Be Placed Under Version Control?


The following model elements can be placed under version control:
■ The model (.mdl file)
■ Logical packages and use-case packages (.cat file)
■ Component packages (.sub file)
■ Deployment diagram (.prc file)
■ Model properties (.prp file)
■ External files associated with model elements

246 Rational Rose 2000, Using Rose


Controlled Units

The model and external files exist by default. However, packages, the
deployment diagram, and the model properties must first be
designated as controlled units before Rational Rose will produce the
separate files for you to place under version control.
If you are using one of Rational Rose’s Version Control add-ins, the Add
to Version Control command automatically designates a package as a
controlled unit. If you are not using a Version Control add-in, you must
manually designate a package as a controlled unit before adding it to
version control, by using the Units commands on the File menu or the
browser’s shortcut menu.

How Are Controlled Units Related?


When you create a controlled unit from a package, its contents are
moved from the model file or enclosing package and stored in the new
file. The file contains the following information:
■ All model elements that are contained by the package
■ All packages that are contained by the package (or a reference to
those packages if they are controlled units themselves)
■ All diagrams that belong to the package
Thus, the original file will no longer hold the contents of the package.
Instead, the original file now only references the new controlled unit’s
file.
Note that the model file only references the first level of controlled units
(as illustrated in Figure 103). Thus, a controlled unit that holds
another controlled unit also holds the reference to that unit.

Figure 103 Example of Division of a Model into Controlled


Units

Rational Rose 2000, Using Rose 247


Chapter 17 Team Development

In this example, articles.cat can be changed without affecting


business_serv.cat. Also, business_serv.cat can be changed without
affecting ordersys.mdl.
A model can also hold links to external files. Rational Rose references
such files in the same way as it references controlled units.

How Are Controlled Units Protected?


When loading a model, the controlled units get the same write-
protection as they currently have in the file system. Thus, a controlled
unit, which is read-only in the file system, gets write-protected in the
model, and Rational Rose prevents you from modifying the unit. This
means that the toolbox is unavailable on all of its diagrams and that
you are not able to update the specifications of the contained model
elements.
Note: If a write-protected controlled unit contains other controlled units,
the write-protection is not extended to the contained controlled units.
Also, the status bar displays information about the selected unit’s
current state—write-enabled, write-protected, and modified. The file
path for the unit is also displayed in the status bar. For example:

Figure 104 Status of Selected Controlled Unit Displayed in


the Status Bar

In addition, if you are using a Rational Rose Version Control add-in


(Version Control or ClearCase), the icon in the browser indicates
whether a controlled unit is checked-in ( ) or checked-out ( ).

Setting Up a Multiuser Environment


The following sample process shows how to set up a multiuser
development environment. It is a general example, so your own specific
process will probably be somewhat different. This sample process
assumes that a version control system is used and that each developer
has his or her own private workspace with access to necessary
controlled units.

248 Rational Rose 2000, Using Rose


Setting Up a Multiuser Environment

Note that Rational Rose can be used with or without a version control
system. When no version control system is used, the sample process is
almost the same, but the version and access control of all files has to
be performed manually by the team members. For example, you can
maintain a shared copy of each controlled unit in a common area and
allocate ownership of the packages among the team members.

Setting Up a Multiuser Environment (General Steps)


1. Integrate Rational Rose with your version control system. If you are
using ClearCase or an SCC-compliant version control system, you
can use one of the version control add-ins to provide this
integration.
2. Establish an integration workspace and a private workspace for
each team member.
In Rational ClearCase, for example, the integration workspace is a
view, which contains baselined or integrated work, and which can
be accessed by all users. Each developer has his or her own private
workspace, which contains the work in progress. For example, the
integration view may be defined as integration_view\model_vob,
and one of the private workspaces may be defined as
jim_view\model_vob. ClearCase workspaces are accessed by
mapping a given view to an arbitrary drive letter. So, a developer
might access the integration view by mapping it to Z and might
access his private view by mapping it to X.
Note: The usage scenario is almost the same if the team is not using
a version control system. Here, the integration workspace is a shared
folder structure where the baseline model and its supporting files are
maintained. A private workspace corresponds to a team member’s
local copy of these folders and files.
3. Decide upon the folder hierarchy into which controlled units will be
stored. For example, in Rational ClearCase, create a directory
versioned element, Z:\ordersystem, for the model file, and a
subfolder, Z:\ordersystem\units, for the packages (.cat files).

Rational Rose 2000, Using Rose 249


Chapter 17 Team Development

4. Define the integration strategy. The following two strategies are


both commonly used:
❑ Only one team member is allowed to work on a unit at a time.
In this case, all development is done on the integration branch,
no branching (multiple simultaneously checked-out versions) of
controlled units is permitted. Developers’ changes should be
reviewed and approved before they are checked back into the
baseline model.
❑ Multiple team members are allowed to work simultaneously on
the same unit.
In this case, multiple versions of the same controlled units may
be checked-out at the same time, and each developer performs
his or her work along a private branch of development.
Developers are free to check out and check in controlled units
on their private branch as needed. Developers’ changes should
be reviewed and approved before they are merged back into the
baseline model. Use the Model Integrator to do this.
5. To allow parallel development from different workspaces, each
team member needs to create a virtual path map, $CURDIR=&.
Defining a path map symbol that references & enables Rational
Rose to reference controlled units independent of the drive where
the model file is located. (See Defining Virtual Paths.)
6. Organize the model in controlled units and put them under version
control.

Setting Up a Multiuse Environment (Steps to Be Performed by Each Team


Member)
1. Make sure that you have a private workspace defined in your
version control system. For copy-based version control systems,
such as Microsoft Visual SourceSafe, initialize your private
workspace by copying the integration workspace folders and files to
each developer’s workspace. If you are using Rational ClearCase,
which uses a dynamic workspace mechanism, simply map your
view to a drive letter.
2. If there is no Rational Rose add-in that provides an integration with
your version control system, you can manually add your system’s
version control commands to a Rose menu. (See Integrating
Rational Rose with a CM System.)

250 Rational Rose 2000, Using Rose


Setting Up a Multiuser Environment

3. To allow parallel development from different workspaces, each


team member needs to create a virtual path map, $CURDIR=&.
Defining a path map symbol that references “&” enables Rational
Rose to reference controlled units independent of the drive where
the model file is located. (See Defining Virtual Paths.)
4. When it is time to start working in the model, open the model and
load the units that you want to view or update. Check out only the
controlled units (packages) that you want to update.
5. Depending on what integration strategy your team is using, merge
or simply check in the units when you have finished updating
them, and they have passed your review process. (See Team
Development Strategies for more information.)
6. To allow parallel development from different workspaces each team
member needs to create a virtual path map, $CURDIR=&, in the Edit
Path Map dialog box:

Figure 105 Virtual Path Map Dialog Box

Defining a path map symbol that references & enables Rational


Rose to reference controlled units independent of the drive where
the model file is located.
See the Virtual Path Maps section in this chapter.

Rational Rose 2000, Using Rose 251


Chapter 17 Team Development

7. Organize the model in controlled units and put them under version
control.
See the Organizing a Model in Controlled Units section in this
chapter.
Note: The usage scenario is almost the same if the team is not using a
version control system. Here, the integration workspace is a shared
folder structure where the baseline Rose model and its supporting files
are maintained. A private workspace corresponds to a team member’s
local copy of these folders and files.

Creating a Custom Version Control Integration


Integrating Rational Rose with a version control system (or CM system)
means to make version control commands available in Rational Rose.
Rational Rose provides integrations for ClearCase (the ClearCase add-
in) and for SCC-compliant systems (the Version Control add-in). Both
of these add-ins provide commands on the Tools menu, as well as from
shortcut menus in the browser and in diagrams.
Note: You must activate either the Version Control add-in or the
ClearCase add-in. Do not activate them both, or you may get error
messages and experience unpredictable results.
If you are using a version control or configuration management (CM)
system that is not compatible with either of these add-ins, you may be
able to create your own custom integration.
If your version control system provides a command-line interface, you
can create an integration using Rational Rose customizable menus.
For example, you can add the most important commands of your
version control system to the CM menu on the File menu’s Units menu
by calling the application’s command-line interface.
For more information about customizing menus or about version
control add-ins, see the online help index.

Working with Controlled Units


To allow parallel development and version control of a model, the model
can be divided into separate work units—that is, controlled units. This
section explains how to organize a model in controlled units and how
to work with them.

252 Rational Rose 2000, Using Rose


Working with Controlled Units

Organizing a Model in Controlled Units


How many packages and controlled units to create is a question for the
project manager and the person responsible for the configuration
management in your project. The granularity level at which you want
to be able to perform version control should define what becomes a
controlled unit. For example, all packages could be made controlled
units, including nested packages. Doing so, provides the capability for
two developers to check-out packages that “belong” to the same higher
level package.
The following picture is an example of how a model has been divided
into controlled units:

Figure 106 Example of Controlled Units in a Model

Each controlled unit is usually owned by one developer, and a


developer may own more than one controlled unit, but a controlled unit
can also be assigned to a team.
The model can be controlled together with other artifacts that are
related to the same development project—for example, source code, the
requirements specification, and testing artifacts. That way, any team
member can easily find all related artifacts.
Please refer to the Rational Unified Process for more information on the
criteria to use when dividing a model into packages and controlled
units.

To divide a model into controlled units:

1. Prepare Rational Rose to be used in a multiuser environment. See


the Setting up a Multiuser Environment section in this chapter.
2. To control a new model, open a new empty model. To control an
existing model, move the model file into the folder where it is going
to be version controlled (for example,
X:\ordersystem\ordersys.mdl) and open it in Rational Rose.

Rational Rose 2000, Using Rose 253


Chapter 17 Team Development

3. Add the model file to version control. For example, if you are using
one of Rational Rose’s version control add-ins, right-click on the
model icon in the browser and click Add to Version Control, which
displays a dialog box like the one shown below. Make sure that the
model file is selected and click OK. (If the model is new, a save
dialog box is displayed. If so, save the model file into the folder
where it is going to be version controlled.)

Figure 107 Sample Add To Version Control Dialog Box

4. Because the model file is affected when a new controlled unit is


created, make sure that the model file is write-enabled: that is, if it
is under version control, you must check the file out.

254 Rational Rose 2000, Using Rose


Working with Controlled Units

5. If it has not been done already, create a package for each part of
the model that needs to be version controlled separately. Decide
which logical packages and component packages represent
appropriate elements for parallel development. For example, create
the following packages:

Figure 108 Logical Packages in a Model

6. Put each package under version control and store each unit’s file in
the order in which it will be version controlled, by using the Add to
Version Control command, if you are using one of the Rose version
control add-ins. Otherwise, use the Control command on the Units
menu. For more information, see the Designating a Package as a
Controlled Unit section in this chapter. For example, create the
following units:

Figure 109 Controlled Units in a Model

Rational Rose 2000, Using Rose 255


Chapter 17 Team Development

7. Save the model and all of its controlled units. Now, the model file
contains references to the created file units, instead of holding the
actual contents of those packages. If you created a virtual path
during step 1, Rational Rose has replaced the file path to each
created controlled unit with that virtual path. For example:

Figure 110 Unit References When Using the Virtual Path Map &

8. Make the updated model file and all controlled unit files available
to the rest of the team members. How to do that depends on the
version control system and the integration strategy you are using.
The model is now ready to be further developed by the development
team. When the model grows, you can create new packages and
controlled units or split controlled units into several units. Also, if you
associate any external files to the model elements, put them under
version control along with the corresponding unit.

Designating a Package as a Controlled Unit


Any package—use-case package, logical package, or component
package—can be designated as a controlled unit.
To designate a package as a controlled unit:
1. Because the model file (or the enclosing controlled unit if the unit
is going to be created inside another unit) is affected when a new
controlled unit is created, make sure that the enclosing file is
write-enabled. If it is under version control, you must check the file
out.

256 Rational Rose 2000, Using Rose


Working with Controlled Units

If you are using one of Rational Rose s version control add-ins:


Right-click on the package in the browser and choose Add to Version
Control. Make sure that the package is selected in the displayed
dialog box (or select several packages as shown in the dialog box
below). Then click OK.

Figure 111 Add To Version Control Dialog Box

In the displayed save dialog boxes, specify the name and storage
location of each controlled unit, which must correspond to the
folder where it is going to be version controlled. Rational Rose
creates a file unit of each selected package and adds them to your
version control system.
If you are not using a version control add-in: Right-click on the
package in the browser and click Control on the Units menu. Specify
the name and location of the file, which will hold the contents of

Rational Rose 2000, Using Rose 257


Chapter 17 Team Development

this controlled unit. Click OK. Rational Rose moves the contents of
the selected package from the model file (or enclosing controlled
unit) into the specified file.

Figure 112 Save Dialog Box

2. Save the model (or enclosing controlled unit), which now references
the specified file instead of holding the actual contents of the
selected package.
3. If you are using a version control system other than one of the Rose
version control add-ins, add the unit to your version control system
and have it checked-in.
4. Make the updated model file (or enclosing controlled unit) and the
new controlled unit file available to the rest of the team members.

Browsing Controlled Units


When a model is opened, Rational Rose asks if all controlled units
should be loaded. To view the model elements contained in a controlled
unit, the unit must be loaded. Rational Rose shows the contents of all
loaded controlled units, but only those that are write-enabled can be
updated. For a write-protected controlled unit, the drawing palette is
dimmed on all of its diagrams and the specifications of the contained
model elements cannot be updated.

258 Rational Rose 2000, Using Rose


Working with Controlled Units

Browsing Controlled Units in the Browser


In the browser, you can see whether a controlled unit is:
■ Loaded —
■ Not loaded —
If you are using the Version Control add-in, the browser also indicates
whether a controlled unit is:
■ Checked-in —
■ Checked-out —
For a controlled unit that is selected in the browser, the status bar
displays information about the unit’s current state—write enabled,
write protected, and modified—together with the unit’s file path:

Figure 113 Status and File Path of Selected Controlled Unit


Displayed in the Status Bar

Browsing Controlled Units in Diagrams


In diagrams, the following icons help you identify controlled units and
their status:
■ on a package means that the package is a controlled unit. (You
can turn this icon off by clearing the Unit adornments option on the
Diagram tab in the Options dialog box.)
■ on a model element means that the package where the model
element is contained is not loaded. (You can turn this icon off by
clearing the Unresolved adornments option on the Diagram tab in the
Options dialog box.)

Rational Rose 2000, Using Rose 259


Chapter 17 Team Development

Loading and Unloading Controlled Units


When you open a model, Rational Rose asks if all referenced controlled
units should be loaded. If the model is large, or you are planning to
work on a few specific units, you can reduce latency and resource
consumption by clicking No. Load individual controlled units only
when you need to view or modify their contents. However, to view or
update a unit that has been modified by another developer since you
loaded it, you must reload the unit.
An unloaded controlled unit is shown as in the browser. In
diagrams, model elements that belong to a not loaded unit are marked
with an , for “missing.”

Loading or Reloading a Specific Controlled Unit


To load a controlled unit into Rational Rose:
1. Right-click on the unit in the browser, and click Load or Reload on
the Units menu.
2. Select the unit file from which to load the controlled unit in the
displayed dialog box. (The unit file currently associated with this
controlled unit is displayed as the default selection.)
Rational Rose loads the selected controlled unit. If the file was write-
protected in the file system, then the controlled unit is write-protected
in the model; otherwise, the controlled unit is write-enabled.
Note: You can also load an unloaded controlled unit by simply double-
clicking on the corresponding package in a diagram. (If the Confirm load of
units option is selected on the General tab of the Options dialog box, you will
have to confirm the load before the unit is loaded.)

Unloading a Controlled Unit


Select the controlled unit in a diagram. Click File > Units > Unload. Or,
right-click on the unit in the browser, and click Unload on the Units
menu.

260 Rational Rose 2000, Using Rose


Working with Controlled Units

Modifying and Saving Controlled Units

Modifying a Controlled Unit


To modify a controlled unit:
1. If the controlled unit is checked-in or unloaded, check-out or load
the unit.
2. Make the necessary changes to the controlled unit.
3. Optionally, to identify inconsistencies in the modified controlled
unit before checking it in to a version control system, you can use
the Check Model command on the Tools menu.
4. Optionally, generate code from the modified unit, but first check
out (or write-enable) any existing source code files that may be
affected by the code generation.
5. If you are using a Rational Rose version control add-in: Check
in the unit by right-clicking on the package in the browser and
clicking Check In on the displayed menu.
If you are not using a Rational Rose version control add-in:
Save the unit by right-clicking on the unit in the browser and
clicking Save on the Units menu. Check in the unit in your version
control system.
Note: If the unit has been altered by another user since you checked it
out, merge the two versions before you check it in. (See the Merging
Controlled Units section in this chapter.)

Saving a Controlled Unit to Its Associated File


Right-click on the controlled unit in the browser and click Units > Save.
(This operation fails if the file system’s access control setting for the
unit file is read-only.)

Saving a Controlled Unit to a New File


To save a controlled unit to a new file:
1. Right-click on the controlled unit in the browser and click Units >
Save As.
2. In the displayed dialog box, type the name of the new file in which
to save the controlled unit.

Rational Rose 2000, Using Rose 261


Chapter 17 Team Development

Uncontrolling Controlled Units


Uncontrolling a controlled unit means to incorporate its contents into
the model file, or into the enclosing controlled unit if the unit to
uncontrol is contained within another unit. After uncontrolling a unit,
the enclosing file will no longer reference that unit’s file. Instead, the
contents of the uncontrolled unit’s file is inserted into the enclosing
file.
To incorporate the contents of a controlled unit into the model file:
1. Because the model file (or enclosing controlled unit) is affected
when removing a controlled unit, make sure that the model file (or
the enclosing controlled unit) is write-enabled. If it is under version
control, you must check the file out.
2. If you are using a Rational Rose version control add-in: Right-
click on the unit in the browser and chose Remove from Version Control.
Make sure that the package is selected in the displayed dialog box.
Then click OK. The contents of the unit is now incorporated into the
corresponding package in the model, and the file is removed from
version control.
If you are not using a Rational Rose version control add-in:
Right-click on the package in the browser and click Uncontrol on the
Units menu. The contents of the unit is now incorporated into the
corresponding package in the model, but the file is still available in
the file system.
3. Save the model (or enclosing controlled unit), which now holds the
contents of the unit file instead of only referencing it.
4. Finally, make the updated model file (or enclosing controlled unit)
available to the rest of the team members.
5. Optionally, delete the uncontrolled unit’s file.

Splitting a Controlled Unit


If a controlled unit becomes too large or if several team members often
need to update a unit at the same time, you can split the unit. There
are two ways to split a controlled unit:
■ Remove the unit and split it into two different units (as in figure
114)
■ Keep the unit, but divide its contents into two new sub-units (as in
figure 115)

262 Rational Rose 2000, Using Rose


Working with Controlled Units

Splitting a Controlled Unit into Two Units


To split a controlled unit into two units, as in the following figure,
follow the steps below.

Figure 114 Splitting a Unit Into Two Units

1. Make sure that the controlled unit is write-enabled. That is, if it is


under version control, you must check out the file.
2. Because the model file (or enclosing controlled unit) is affected
when a controlled unit is created or removed, make sure the model
file (or the enclosing controlled unit) is write-enabled or checked-
out.
3. If you want the original unit to constitute one of the new units,
create one new package at the same level as the controlled unit.
Otherwise, create two new packages.
4. Move the contents that should belong to the new package,
including the associations, from the unit into that package, by
using drag and drop in the browser. Or, move the contents by
selecting the elements in a diagram, copying the elements to the
clipboard, pasting them into a diagram that is owned by the new
package, and then clicking Edit > Relocate. The diagram-based
method is more efficient if numerous elements are to be relocated.
5. Designate the new package(s) as a controlled unit. See the
Controlled Units section.

Rational Rose 2000, Using Rose 263


Chapter 17 Team Development

Dividing the Contents of a Controlled Unit into Two Sub-


Units
To divide the contents of a controlled unit into two sub-units, as in the
following figure, follow the steps below.

Figure 115 Dividing a Unit Into Two Sub-Units

1. Make sure the controlled unit is write-enabled. That is, if it is


under version control, you must check the file out.
2. Create two new packages in the package that corresponds to the
controlled unit.
3. Move the contents from the unit into the two packages by using
drag and drop in the browser. Make sure to move any associations
as well.
4. Designate the new packages as controlled units. See the Controlled
Units section.

Merging Controlled Units


You can compare and merge multiple versions of a controlled unit by
using the Model Integrator.
Note: For more information, see the Model Integrator chapter in this
manual.

264 Rational Rose 2000, Using Rose


Working with Controlled Units

Importing a Controlled Unit from Another Model


To import a controlled unit from another model:
1. Because the model file (or enclosing controlled unit) is affected
when importing a controlled unit into the model, make sure that
the model file (or the enclosing controlled unit) is write-enabled. If
it is under version control, you must check out the file.
2. Open a diagram in the logical/component view, or a diagram that
belongs to the package to which the imported controlled unit
should belong.
3. Click File > Import.
4. Select the unit file you want to import and click OK.
5. Save the model (or enclosing controlled unit), which now references
the imported file.
6. Make the updated model file (or enclosing controlled unit) and the
imported controlled unit file available to the rest of the team
members.
The controlled unit is inserted into the package to which the current
active diagram belongs. The next time you save the model, a reference
to the imported controlled unit is stored in the model file (or the
enclosing controlled unit).

Write Protecting Controlled Units


If you are using a Rational Rose version control add-in, the add-in
handles the write-protection of controlled units automatically. Thus, a
checked-in unit is automatically write-protected in Rational Rose.
However, even if you are using a version control system, there may be
situations when you may want to write-protect or write-enable a
controlled unit manually from within Rational Rose. For example, if:
■ You want to load a checked-in unit, modify it, and save the result
to a new file. To do this, you must manually write-enable the unit
after loading.
■ You have loaded a checked-out unit with the intention of browsing
rather than modification; manually write-protecting the unit
assures that you will not inadvertently change it. Once you reload
the model, write-protection is no longer applicable, and you will be
able to edit and alter the file as before.

Rational Rose 2000, Using Rose 265


Chapter 17 Team Development

You can temporarily change a controlled unit’s write-protection from


within Rational Rose, by using the Write Protect and Write Enable
commands on the Units menu. Note, however, that these commands do
not alter the file’s access control in the file system. For example, if you
load a checked-in or read only unit, and manually write-enabled it in
the model, you will not be able to save the unit.

Write-Protecting a Controlled Unit


A controlled unit can be write-protected in three different ways:
■ If you are using a version control system, place the controlled unit
under version control and have it checked-in.
■ Make the file read only, by setting the file protection of the .cat file
to read-only in the underlying file system.
■ By right-clicking on the controlled unit in the browser, and clicking
Write Protect on the Units menu. However, once you reload the model,
write-protection is no longer applicable, and you will be able to edit
and alter the file as before.
Using one of the procedures above, the controlled unit and its contents
can no longer be modified in Rational Rose.
Note: If a write-protected controlled unit contains other controlled units,
the write-protection is not extended to these contained controlled units.

Allowing Modification of a Controlled Unit


If you are using a Rational Rose version control add-in, right-click on
the controlled unit in the browser and click Check Out. This will check
the unit out and allow you to edit it.
If you do not want to check it out, but still want to make changes to it,
you can click Write Enable on the Units menu. Note, however, that this
operation has no effect on the file system’s access control setting for
the file that is associated to this controlled unit. For example, if you
load a checked-in or read only unit, and manually write-enabled it in
the model, you will not be able to save the unit (but you can save it to
a new file).

266 Rational Rose 2000, Using Rose


Working with Controlled Units

Creating a Controlled Unit of the Model Properties


Each language add-in in Rational Rose is associated with a number of
model properties which map the model elements to constructs of the
target language. For each model element, you can customize its
mapping to code by modifying the model properties for that element.
You can also create one or more model property sets with a predefined
combination of values for the properties of that kind of element, and
then apply one property set to all model elements that should be
mapped in the same way.
It is usually a good idea to define some default property sets to be used
by all members within the development team. By designating the
property sets into a controlled unit, and putting the file under version
control, you can prevent the property sets from being modified by
mistake.
To create and designate the current model properties as a controlled
unit:
1. Make sure that the model file is write-enabled. That is, if it is under
version control, you must check the file out.
2. Define the model property sets on the language tabs in the Options
dialog box.
3. If you are using a Rational Rose version control add-in: Right-
click on the Model Properties icon in the browser ( ), and click
Control on the Units menu. Click OK. In the displayed dialog box,
specify the name and storage location of the model property file to
create (for example, X:\ordersystem\ordersys.prp).
If you are not using a Rational Rose version control add-in:
Right-click on the Model Properties icon in the browser ( ), and
click Control on the Units menu. In the displayed dialog box, specify
the name and storage location of the model property file to create
(for example, X:\ordersystem\ordersys.prp). Click OK.
4. Rational Rose creates a controlled unit from the current model
properties. When another team member opens the updated model,
he or she will automatically get the model properties from the
created property file (.prp file).

Rational Rose 2000, Using Rose 267


Chapter 17 Team Development

Virtual Path Maps


The references to controlled units are stored as file paths in the model
file or parent units. To allow models to be moved between different
folder structures and to be updated from different workspaces,
Rational Rose provides a mechanism called virtual path maps. Virtual
path maps are used to reference controlled units using a virtual path
instead of an absolute path.

How Do Virtual Paths Work?


When Rational Rose saves a model, it tries to substitute every absolute
path with a virtual path. When Rational Rose later opens a controlled
unit, or uses a path specified in a model property, each virtual path is
transformed back into an absolute path.
For example, if a user has defined a virtual path:
$MYPATH=Z:\ordersystem,
and saves a package as:
Z:\ordersystem\user_services.cat,
the model file will refer to the package as:
$MYPATH\user_services.cat.
When another user, who has defined $MYPATH as:
$MYPATH=X:\ordersystem,
opens the same model from his or her X drive, Rational Rose resolves
the internal reference to the controlled unit and loads the following file:
X:\ordersystem\user_services.cat.
A leading & in a path map represents the folder where the enclosing
controlled unit or model file is located, and can be used to reference
units relative to model files and other units. See Defining a Path Map
Relative to the Location of the Model File below. Also, a wildcard, *, in
the path map can be used to parameterize a virtual path. See Defining
a Parameterized Path Map below.

268 Rational Rose 2000, Using Rose


Virtual Path Maps

Defining Virtual Paths


To define a virtual path:
1. Open the model in Rational Rose. Make sure that the model file
and all of its controlled units are write-enabled. (If they are under
version control, you must check them out.)
2. Click File > Edit Path Map. The Virtual Path Map dialog box opens:

Figure 116 Virtual Path Map Dialog Box

The dialog box contains a list of entries; each entry represents a


mapping between a virtual path symbol and an absolute path. For
example, in figure 116, the virtual path symbol, $MYPATH, is
defined as the absolute path Z:\ordersystem.
3. Type the name of the new virtual path in the Symbol box (for
example, “MODELPATH”). Note, that the leading dollar sign must be
omitted in the Symbol box.
4. In the Actual Path box, enter the folder where the model file is
located.

Rational Rose 2000, Using Rose 269


Chapter 17 Team Development

5. Click Add. You have now defined a virtual path map symbol,
$MODELPATH.
6. To substitute the current physical paths to any existing controlled
units in the model file, save the model and all of its controlled
units.
Note: Each user that is going to work on this model will have to
define the same path map symbol before opening the model. For
example, another user with the private workspace Y:\ordersystem,
must define $MYPATH=Y:\ordersystem.

Defining a Path Map Relative to the Location of the Model File


A leading & on a path name indicates that the path is relative to the
model file or the enclosing controlled unit (if any). For example,
suppose you have created a model:
X:\ordersystem\ordersys.mdl
and a controlled unit:
X:\ordersystem\units\data_serv.cat.
To allow different users to open the model and load the unit in different
workspaces, each user can create a path map:
$CURDIR=&.
When the model is saved, the reference from the model file to the
package is stored as:
$CURDIR\units\data_serv.cat
When the model is opened in another workspace, $CURDIR is
expanded to the physical path to the model in that specific workspace,
for example:
Z:\ordersystem.
Note: The & requires that the controlled units are located in the same
folder as the model file or in a subfolder to the model file.

Defining a Path Map Using Another Path Map Symbol


The actual path in a path map definition can contain previously
defined path map symbols. For example, if there is a path map:
$ROOT=X:\model_vob,

270 Rational Rose 2000, Using Rose


Virtual Path Maps

you can define a path map for the path:


X:\model_vob\ordersys
by adding the path map:
$MYPATH=$ROOT\ordersys.

Defining a Parameterized Path Map


A wildcard character, *, in the path map can be used to parameterize
a virtual path. For example, if the following virtual path is defined:
$SUBSYSTEM=\\server\models\project\*\fred
and each user working on project has his or her own set of model files
within each subsystem, then a controlled unit belonging to the display
subsystem may have the following path:
\\server\models\project\display\fred\diagrams.cat
the model file will refer to the unit as:
$SUBSYSTEM(display)/diagrams.cat

When the model is opened by user “susanne,” who has the following
virtual path definition:
$SUBSYSTEM=\\server\models\project\*\susanne

the virtual path reference to the unit is transformed back to the actual
path:
\\server\models\project\display\susanne\diagrams.cat
This allows different users to work on the same files, with the same
contents, but in different folders, without having to define a virtual
path symbol for each such folder.

Using Virtual Paths in the Value of a Model Property


Rational Rose does not convert absolute paths in model properties to
virtual paths. In order to use a virtual path in the value of a model
property, you must manually enter the virtual path symbol, including
the $ sign—for example, $CURDIR—into the model property value.

Rational Rose 2000, Using Rose 271


Chapter 17 Team Development

Using Rational Rose in a Team


The way you use Rational Rose differs depending on what version
control system your team is using (if any at all) and the integration
strategy you deploy. The following examples exemplify how to use
Rational Rose with two different integration strategies:
■ Only one team member is allowed to work on a unit at a time
■ Multiple team members are allowed to work simultaneously on the
same unit

Example project description


In these examples, the team members are assumed to be working in a
Windows environment and they are using Rational’s ClearCase for
version control. This means that they can use the ClearCase add-in
commands in Rational Rose.
The “master” version of the Rose model and its supporting files are kept
in an integration workspace (a ClearCase “view”) that is maintained
under ClearCase. Each developer works on their own version of the
model, in a private workspace.
The usage scenario is almost the same if the team is not using a version
control system. In that case, the integration workspace is a shared
folder structure where the baseline Rose model and its supporting files
are maintained. A private workspace corresponds to a team member’s
local copy of these folders and files.
The sample project is developing an order system. The main logical
packages in the model—User Services, Business Services, and Data
Services—have been designated as controlled units, to allow parallel
development of each service layer.
The model and its controlled units are stored in a ClearCase version
control repository (Versioned Object Base or VOB) as follows:

Figure 117 Controlled Units of the Example Model

272 Rational Rose 2000, Using Rose


Using Rational Rose in a Team

When the model was first created, each team member created a virtual
path map symbol, $CURDIR=&. This symbol enables Rational Rose to
store references to controlled units using paths that are relative to the
location of the model file. That way, the project members may work in
different private workspaces (“views” of the VOB). For example, Joe
may have used NT (or Windows) Explorer to map his view to the drive
letter “X”, and Jill may have mapped her view to “Y”.

One Team Member Allowed to Work on a Unit at a Time


The following example illustrates how to use Rational Rose in a project
team where only one team member is allowed to work on a controlled
unit at a time. In this case, each user’s ClearCase “view” is configured
so that all work is performed on versions of controlled units that exist
on the main line of development. That is, each developer is modifying
files that are part of the baseline version of the model.

Example scenario 1

The following updates need to be made:


■ Joe needs to update user_serv.cat
■ Jim needs to update business_serv.cat
■ Jill needs to update data_serv.cat
The following happens:
1. Each developer opens the ordersys.mdl model in their private
workspaces. Because each developer has defined a virtual path for
their private workspaces, Rational Rose resolves the path to the
referenced .cat files in the context of each developer’s workspace.
In Jill’s case, Rational Rose looks for the .cat files in
Y:\ordersystem\units, because Jill mapped her ClearCase view to
the “Y” drive.
2. Each developer checks out the package (controlled unit) that they
need from their version control system. As they are using
ClearCase on Windows, they right-click on the package in the
browser and click Check Out on the displayed shortcut menu. They
will have read-write access only to the package they check out.
3. Each developer makes the necessary changes to the package they
have checked-out, without impacting other packages.

Rational Rose 2000, Using Rose 273


Chapter 17 Team Development

4. After their changes are made, the changes are reviewed for
acceptability before the controlled units are checked back in.
5. Once the changes are approved, each developer checks their
controlled unit in. This is done by right-clicking on the unit’s
package in the browser and clicking Check In on the displayed
shortcut menu.
6. Developers can update their model with each other’s changes by
using the ClearCase add-in’s Get Latest command.

Example Scenario 2

Both Joe and Jill need to update user_serv.cat.


The following happens:
1. Jill, who is the owner of user_serv.cat unit, creates two
subpackages in the User Services package—one package is for her
updates, and one is for Jim’s updates.
2. Jill moves the model elements of interest from the User Services
package to the two subpackages.
3. Jill adds the two new packages to version control.
4. Joe and Jill modify their subpackages. When the work is complete,
Jill uncontrols the temporary subpackages, relocates the contained
model elements to the original package (including any associations)
and deletes the now empty temporary subpackages.

274 Rational Rose 2000, Using Rose


Using Rational Rose in a Team

Multiple Team Members Allowed to Simultaneously Work on the Same


Unit
In this scenario, the project team allows multiple team members to
work simultaneously on the same controlled unit. In this case, each
user’s view is defined so that all users’ work occurs on private branches
of development.
Both Joe and Jill need to update user_serv.cat. The following happens:
1. Joe and Jill open the ordersys.mdl model in their private
workspaces. Because they both have defined a virtual path for their
private workspaces, Rational Rose resolves the path to the
referenced .cat files in the context of each developer’s workspace.
For example, in Jill’s case, Rational Rose looks for the .cat files in
Y:\ordersystem\units.
2. Joe checks out user_serv.cat. As he is using ClearCase on
Windows, he right-clicks on the package in the browser to bring up
the shortcut menu, and then clicks Check Out. ClearCase checks out
a version of the unit onto Joe’s private version branch.
3. Jill checks out user_serv.cat onto her separate version branch.
4. Joe finishes his changes and checks in user_serv.cat. That is, he
right-clicks on the package in the browser and clicks Check In on the
displayed shortcut menu. ClearCase checks in the file on the
version branch that is referenced by Jim’s view.
5. Jill finishes her changes and checks in her version of
user_serv.cat. ClearCase produces a new version of the file on Jill’s
private development branch.
6. Once Joe’s and Jill’s changes are checked in, the project leader (or
a designated developer) uses the Model Integrator to compare, accept
changes, and merge their controlled units back into the baseline
version of the model. For more information about that tool, please
refer to the Model Integrator chapter in this manual.
7. The other developers can view Joe’s and Jill’s changes when
reloading the user_serv.cat unit from the baseline model. The unit
can be reloaded using the ClearCase add-in’s Get Latest command.

Rational Rose 2000, Using Rose 275


Chapter 18

Version Control Add-Ins

Partitioning a Model for Version Control


Partitioning a Rose model into units is useful for both team
development and for version control.
Rational Rose provides two separate add-ins that you can integrate
with your version control system:
■ The Version Control add-in, for use with any SCC-compliant
version control system
■ The ClearCase add-in, for use with Rational ClearCase
This chapter describes some of the major version control tasks you can
accomplish with these add-ins. For complete details, use the Version
Control and ClearCase add-in online help.
Because packages constitute the basic unit of work, any model
package can be saved as a controlled unit.
■ Logical packages are given the file extension .cat
All packages, use cases, classes, relationships, and diagrams
contained in a logical package are included in the .cat file.
■ Component packages are given the file extension .sub
Note, however, that you cannot control the Use Case View, Logical
View, Component View, and Deployment View packages; that is, the
top level package of each view.

Rational Rose 2000, Using Rose 277


Chapter 18 Version Control Add-Ins

In addition to controlling packages, you can also control:


■ An entire model (.mdl file extension)
■ A model’s deployment diagram (.prc file extension)
■ A model’s property set (.prp file extension)
■ Any external file, such as a documentation file, that has been
associated with a model element.
Each package can be placed under version control by using the Add to
Version Control command, which creates a controlled unit from the
package and adds it to version control.
Note: The Version Control Add-In manages only the model and its
controlled units, not the corresponding source code files, even if they
have been generated from a Rose Add-In. However, the Clear Case Add-
In manages files generated by the C++ and Ada Add-Ins.
In the browser, you can see whether a controlled unit is:
■ Loaded —
■ Not loaded —
■ Checked in —
■ Checked out —

About the Version Control Add-In


The Version Control add-in provides integration between Rational Rose
and any SCC-compliant version control system. It makes the most
frequently used version control commands accessible directly from the
Tools menu and from shortcut menus in Rose. For example, you use
the Version Control Add-In to:
■ Add packages to version control, which you must do before you can
check out or check in the packages
■ Check out and check in packages
■ Start your SCC-compliant version control system
Version Control logs its actions in the Rose log window, as well as in
the log file that you specify on the Log tab of the Version Control
Options dialog box.

278 Rational Rose 2000, Using Rose


About the ClearCase Add-In

The Version Control Add-In automatically determines which version


control system is installed. To see which version control system and
SCC API version the Version Control Add-In is using, click Version
Control on the Tools menu, then click Version Control Options.
Important: For the Version Control Add-In to work with your version
control system, the version control system has to be correctly set up,
see Setting Up Your Version Control System.

About the ClearCase Add-In


The ClearCase add-in provides a tight integration between Rational
Rose and Rational ClearCase. In addition to the generic version control
commands provided by the Version Control add-in, the ClearCase add-
in provides:
■ Reserved and unreserved checkout
■ ClearCase query and browse commands
■ Support for managing files generated by the C++ and Ada Add-Ins
■ ClearCase-specific log reporting, including the Cleartool commands
issued and complete ClearCase output messages for each
command
Important: For the ClearCase Add-In to work with Rational ClearCase,
ClearCase has to be correctly set up. See Setting Up ClearCase for more
information.

Prerequisites
Before the Version Control or ClearCase add-ins can work properly,
you must:
■ Set Up Your Version Control System
■ Choose and Activate the appropriate Version Control Add-In
■ Set Up a Multiuser Environment (See Chapter 16)
■ Organize the Model into Controlled Units (See Chapter 16)
Note: The Version Control Add-In is only available on Windows.

Rational Rose 2000, Using Rose 279


Chapter 18 Version Control Add-Ins

Setting Up Your Version Control System


Both the ClearCase and Version Control add-ins require that you have
an installed, compatible version control system, a user account for that
system, and a basic knowledge of your versioning tool. You must also
set up your specific version control system.

Setting Up ClearCase
ClearCase uses a common Versioned Object Base (VOB) in which all
development artifacts are stored. The basic mechanism for team
development is to have different users on a project use different views
on the VOB. A view is a work area, or workspace, that transparently
provides dynamic, private access to the development folder structure
and files.
A user sees the VOB through one or several views. These views have
rules that determine which particular version of the files the user will
see. A developer working on a specific project or release must work in
a view that is specific to that release. On Windows NT, each view is
usually accessed through a specific drive letter.
If you are using the ClearCase Add-In and Rational ClearCase as your
version control system, follow these steps to set up your ClearCase
environment to work with Rose:
1. Create and mount a ClearCase VOB (for example, ProjectRose).
Note that both VOBs and views must be created directly in
ClearCase; that is, outside Rose.
2. Create a ClearCase view to provide access to the VOB you created.
If you are using ClearCase on Windows, you will need to map the
view to an appropriate Windows NT drive (for example, z:\)
3. Create all necessary views and prepare the model for team
development (see Setting Up a Multiuser Environment) and
organize the model in controlled units (see Organizing the Model in
Controlled Units).

280 Rational Rose 2000, Using Rose


Setting Up Your Version Control System

4. To create the rose_unit element type in the VOB(s) where you store
model files, do one of the following:
❑ If you are using Rose in the Windows NT environment:
– In a ClearCase command prompt window, change the
directory to point to a drive and path representing a view and
the VOB where your model files will be.
– Create the element type in this VOB, by typing:
cleartool mkeltype -supertype text_file -manager _rose
-c "Model files" rose_unit
❑ If you are using Rose in a Unix environment, click
Tools ->ClearCase->Setup VOB for Rose Units to add the rose_unit
element type and type manager to the VOB.

Setting Up Microsoft Visual SourceSafe


If you are using the Version Control Add-In with Microsoft Visual
SourceSafe as your version control system, follow these steps to set it
up to work with Rose:
1. Make sure there is a Microsoft Visual SourceSafe database
available to store the model. The database must be created directly
in SourceSafe.
2. As the Version Control Add-In uses the current user name to
identify the SourceSafe user, the system administrator must enter
you as a user before you can use the integration. (To find out what
is the current user name, click Version Control on the Tools menu
in Rose, and then click Version Control Options.)
3. In Microsoft Visual SourceSafe, open the database where the model
is going to be stored and create a project for the model. (You can
start the application from within Rose by clicking Start Version
Control Explorer on the Tools menu’s Version Control menu.)
4. Right-click on the project and click Set Working Folder. Select an
existing working folder where you want to version control your
model or create a new folder.
Note: If you attempt to control two files of the same name in the same
SourceSafe project, but you specify different working folders for the files
(for example, c:\NewPackage.cat and c:\temp\ NewPackage.cat),
SourceSafe controls the first file in the project (c:\ NewPackage.cat), but
it will not control the second file (c:\temp\ NewPackage.cat).
No error message will inform you that the second file was not controlled.

Rational Rose 2000, Using Rose 281


Chapter 18 Version Control Add-Ins

For this reason, it is highly recommended that you save all the files from
a single project in the same working folder. Otherwise, you may think
you have controlled a file, when you actually have not done so.
5. Click Tools > Options. On the Command Line Options tab, select the
Assume Project Based on Working Folder check box.

Figure 118 SourceSafe Options Dialog Box

Now you can prepare the model for team development (see Setting Up
a Multiuser Environment) and organize the model in controlled units
(see Organizing the Model in Controlled Units). (The files that are
associated with a model are treated as binary files by Microsoft Visual
SourceSafe.)
Troubleshooting: If the Version Control commands on the Tools menu
in Rose do not work, the SourceSafe Integration component in
SourceSafe may not be installed. To install that component, start the
Microsoft Visual SourceSafe setup program. Click the Add/Remove
button and select the Enable SourceSafe Integration option on the
Maintenance Mode page.

282 Rational Rose 2000, Using Rose


Choosing and Activating a Version Control Add-In

Setting Up Other Version Control Systems


For information on setting up any other SCC-compliant version control
system, refer to your version control system’s user documentation or
online help.

Choosing and Activating a Version Control Add-In


When you install Rational Rose, the installation program detects
whether ClearCase or an SCC-compliant version control system is
installed on your system. Based on this detection, either the Version
Control Add-in or the ClearCase Add-In is activated by default on your
system.
If you install or change your version control system after you have
installed Rose, you must ensure that the appropriate add-in is
activated. In addition, make sure that only one of the version control
add-ins is active at a time. Because the Version Control and ClearCase
add-ins use many of the same commands, you may get error messages
or unpredictable results if both are activated.
To activate or deactivate a version control add-in, click Add-In
Manager… on the Add-Ins menu and click the add-ins you want to
activate or deactivate.
Note: If you are using Rational ClearCase for version control, we
recommend that you activate the ClearCase Add-In, even though in the
Windows NT environment, you can also use the Version Control Add-In.
The ClearCase Add-In provides a much tighter integration and gives you
It is not recommended that you create new projects in the dialog box that
is displayed when clicking the Browse button. However, if you do, the
working folder for the new project becomes the same as the folder where
you save the controlled units that you are adding to version control.

Rational Rose 2000, Using Rose 283


Chapter 18 Version Control Add-Ins

Using Version Control with a Previously Controlled Model


If a model has already been put under version control, but not through
the Version Control add-in, you must add the controlled units to
version control using the Add to Version Control command. If you do
not do this, the Version Control add-in will be unaware of the
previously controlled units.
Note: This information applies only to the Version Control add-in. If you
are using the ClearCase add-in, you do not have to do anything else. The
Make sure that the model is not opened in Rational Rose.
1. In your version control system, check out all the controlled units
that belong to the model. (This cannot be done through the Version
Control Add-In because it does not know that the model is under
version control.)
2. In Rational Rose, open the model, load all units, and click Tools >
Version Control > Add to Version Control or Tools > ClearCase > Add to Version
Control.
3. If you want to check in the files after this operation, clear the Keep
Checked Out check box. (You may need to click the Advanced button
to view this option.)
4. If you are using Visual SourceSafe: Click the Browse button and
search for the project, then click OK. If all the files are located in the
same project, click Select All, then click OK. Otherwise, click the
check box next to each file that is located in the selected project,
click OK, and then repeat steps 3-5 for each set of files that are
located in a different project.
The model is already under version control. The Version Control add-
in only updates the controlled units with some additional Version
Control information, but from now on you can use the Version Control
commands to check out and check in the units.

284 Rational Rose 2000, Using Rose


Checking Out Controlled Units

Checking Out Controlled Units


To check out a loaded controlled unit from your version control system,
use the following steps
Note: To be able to check out a controlled unit using the Version Control
add-in, the unit must previously have been added to version control from
within Rational Rose by using the Add to Version Control command. This
is not a requirement for the ClearCase add-in.
1. Right-click a unit in the browser or diagram and click Check Out on
the shortcut menu. A list with all loaded, checked in controlled
units in the current model is displayed. Any units that are
currently selected in the browser or diagram are selected by default
in the list.

Figure 119 Sample Check-out Dialog Box

Rational Rose 2000, Using Rose 285


Chapter 18 Version Control Add-Ins

2. Select the units you want to check out.


3. Optionally, write an explanation of the checkout in the Comment
box. The text you type will be stored by your version control system
as history for the current checkout.
4. Optionally, click the Advanced button to display a dialog box with
additional options. For example, if you are using ClearCase, you
can make an unreserved check-out with the advanced options.
(Note that the Advanced button is not available for all version control
systems.)
5. Click OK. Rational Rose checks out the files and makes the
contained model elements editable.
6. If Rational Rose asks whether you want to load the unit, click Yes.
Note: If you are using Visual SourceSafe, the Check Out command can
only handle files that are located in the same SourceSafe project and
working folder. To check out files that belong to different projects, you
must repeat the Check Out command for each project.

286 Rational Rose 2000, Using Rose


Checking In Controlled Units

Checking In Controlled Units


To check in a loaded controlled unit into your version control system,
use the following steps.
Note: To be able to check in a controlled unit using the Version Control
add-in, the unit must previously have been added to version control from
within Rational Rose by using the Add to Version Control command. This
is not a requirement for the ClearCase add-in.
1. Right-click a unit in the browser or a diagram and click Check In on
the shortcut menu. A list with all loaded, checked-out controlled
units in the current model is displayed. Any units that are
currently selected in the browser or in a diagram are selected by
default in the list.

Figure 120 Sample Check-in Dialog Box

2. Select the appropriate units.


3. Optionally, write an explanation of the checkin in the Comment box.
The text you type will be stored by your version control system as
history for the current check-in.

Rational Rose 2000, Using Rose 287


Chapter 18 Version Control Add-Ins

4. Optionally, click the Advanced button to display a dialog box with


additional options. For example, in order to check in an unchanged
unit in ClearCase, you must select the Check in even if identical option
in the Advanced dialog box. If you do not select that option you will
get an error message. (Note that the Advanced button is not available
for all version control systems.)
5. Click OK. Rational Rose checks in the units and makes the
corresponding model elements read-only in the model.
Note: If you are using Visual SourceSafe, the Check In command can
only handle files that are located in the same SourceSafe project and
working folder. To check in files that belong to different projects, you
must repeat the Check In command for each project.

Undoing the Check-Out of Controlled Units


To undo the check-out of a loaded controlled unit and to load the latest
checked-in version:
1. Click Tools > Version Control or Tools >ClearCase, and then click Undo
Check Out. A list with all loaded, checked-out controlled units in the
current model is displayed. Any packages that are currently
selected in the active diagram are selected by default in the list.
2. Select the checked-out unit.
3. Optionally, click the Advanced button to display a dialog box with
additional options. Note that this button is not available for all
version control systems.
4. Click OK.
5. If Rational Rose asks whether you want to save the changes before
loading a new unit, click No.
Note: If you are using Visual SourceSafe, the Undo Check Out command
can only handle files that are located in the same SourceSafe project and
working folder. To undo the check-out of files that belong to different
projects, you must repeat the Undo Check Out command for each project.

288 Rational Rose 2000, Using Rose


Getting the Latest Version of Controlled Units

Getting the Latest Version of Controlled Units


To copy the latest checked-in version of a controlled unit to your Visual
SourceSafe working folder or to dynamically access it via a ClearCase
view in order to load that version into the model, use the following
steps:
1. Click Tools > Version Control or Tools > ClearCase, and then click Get Latest.
A list with all loaded, checked-in controlled units in the current
model is displayed. Any packages that are currently selected in the
active diagram are selected by default in the list.
2. Select the appropriate unit.
3. Optionally, click the Advanced button to display a dialog box with
additional options. Note that this button is not available for all
version control systems.
4. Click Get.
5. If Rational Rose asks whether you want to save the changes before
loading a new unit, click No.
Note: If you are using Visual SourceSafe, the Get Latest command can
only handle files that are located in the same SourceSafe project and
working folder. To get the latest versions of files that belong to different
projects, you must repeat the Get Latest command for each project.

Removing Controlled Units from Version Control


To remove a loaded controlled unit from version control, use the
following steps:
1. Make sure that the unit to which the unit belongs is checked out.
2. Click Tools > Version Control or Tools > ClearCase, and then click Remove
From Version Control. A list with all loaded, checked-in controlled units
in the current model is displayed. Any packages that are currently
selected in the active diagram are selected by default in the list.
3. Select the unit that you want to remove.
4. Optionally, click Advanced to display a dialog box with additional
options. This button is not available for all version control systems.

Rational Rose 2000, Using Rose 289


Chapter 18 Version Control Add-Ins

5. Click OK. The selected unit is removed from version control and its
contents are incorporated into the model, but will continue to exist
as:
❑ For Visual SourceSafe: A file in your working folder.
❑ For ClearCase: A file in your view if you are using a snapshot
view, but the file is automatically removed from all dynamic
views.
Note: If you are using Visual SourceSafe, the Remove From Version
Control command can only handle files that are located in the same
SourceSafe project and working folder. To remove files that belong to
different projects, you must repeat the command for each project.
If you are using the Version Control add-in, to be able to check in a
controlled unit from within Rose, the unit must previously have been
added to version control from within Rose by using the Add to Version
Control command. This restriction does not apply to the ClearCase add-
in.

290 Rational Rose 2000, Using Rose


Displaying Version Control System Information

Displaying Version Control System Information


Use the Version Control Options dialog box to display information about
your version control system and about the error log.
To open the dialog box, click Tools > Version Control > Version Control Options.

Figure 121 Sample Version Control Options Dialog Box

Note: This dialog box is only available for the Version Control add-in; it
does not apply to the ClearCase add-in.

General Tab
The General tab displays general information about your version control
system. The following information is displayed (but cannot be altered):
Version Control Provider: The name of the version control system that is
installed on your system. The Version Control Add-In checks the
following key in the Windows Registry to find out which version control
system you have installed:
HKEY_LOCAL_MACHINE/Software/SourceCodeControlProvider/Prov
iderRegKey
Version Control API Version: The version of the Source Code Control (SCC)
API that the Version Control Add-In supports.

Rational Rose 2000, Using Rose 291


Chapter 18 Version Control Add-Ins

Username: The current user name on your system, which is needed by


some version control systems when the Version Control Add-In logs in
to the application.
Current Project: For Visual SourceSafe, this box shows the name of the
current project— that is, the project that the Version Control Add-In
accessed last time you performed a version control command. This box
is not used for ClearCase.
Local Project Path: For Visual SourceSafe, this box shows the name of the
current working folder— that is, the working folder that the Version
Control Add-In accessed last time you performed a version control
command. This box is not used for ClearCase.

Log Tab
On the Log tab, you can open or create the Rational Rose log file where
the version control actions can be written. Enter the name of the
Rational Rose log file, and then click Open. If the log file is located in the
Rational Rose installation folder, the file name is sufficient. Otherwise,
give the full file name including the file path.

Frequently Asked Questions About Version Control Add-Ins

My model has been put under version control directly via my


version control system. Can I use the version control commands
on those units?

Yes, but if you are using the Version Control Add-In (not the ClearCase
Add-In), you must first make the Add-In aware of the files. To do that,
simply add the model and all its controlled units to version control by
using the Add to Version Control command. Before opening the model
in Rose, though, check out all the units directly in your version control
system.

The version control command I used didn t have any effect on


some of the selected units. What is wrong?

If you are using Microsoft Visual SourceSafe, the SourceSafe


environment may not be correctly set up. Start Microsoft Visual
SourceSafe, choose Options from the Tools menu. On the Command
Line Options tab, make sure that the Assume Project Based on
Working Folder option is selected.

292 Rational Rose 2000, Using Rose


Frequently Asked Questions About Version Control Add-Ins

If you are using ClearCase, there are other setup steps you must follow.
See Setting Up ClearCase for details.

I get the error message Source control provider not found when
using any command on the Version Control menu. What is wrong?

This error message is displayed if there is no SCC-compliant version


control system installed on your system, or if Rose cannot find it
because the SCC API of your version control system is not enabled.
If you get this error message, but do not intend to use the Version
Control Add-In, deactivate the add-in by clicking Add-In Manager on
the Add-Ins menu. In the displayed dialog box, clear the Version
Control Add-In component.
If you are using SourceSafe, you can run the Microsoft Visual
SourceSafe setup program on your machine. You can find the
installation program either in the SourceSafe installation folder or on
the CD. Click the Add/Remove button and select the Enable
SourceSafe Integration option on the Maintenance Mode page.

I get the error message The directory does not exist when
opening the model. What is wrong?

This message is displayed if Rose cannot find one of the contained


controlled units at the specified location. This can happen, for
example, if the model has been saved with absolute file path references
to the contained controlled units and you open the model in your
private workspace, which uses another path. If so, first make sure that
each member of the team defines the same virtual path symbol (but
using their own private workspace or the “&” keyword). Then let the
user that last saved the model, resave it. All references to the controlled
units are then stored with the virtual path symbol that you all defined
and anyone can open the model from his/her own private workspace.

I get the error message Error performing operation. For a more


detailed explanation, try the same operation using your source
code control provider, e.g ClearCase. What is wrong?

This message means that the command could not be performed on


some of the selected units. If you are running ClearCase, this error
message is displayed, for example:

Rational Rose 2000, Using Rose 293


Chapter 18 Version Control Add-Ins

■ If the Check-in even if identical option is not selected in the


Advanced options dialog when checking in an unchanged unit.
■ If you are trying to check out a unit that is already checked out
“reserved” by another user.
■ When checking in a unit that has been changed since you did an
“unreserved” check-out of that unit.
■ When checking in a unit that has been branched in another view.
To get a more specific error message, perform the same operation using
your version control system, instead of from within Rose.

I get the error message The current selection isn t associated


with a project when trying to check out, check in, or remove a
controlled unit. What is wrong?

This error message is displayed if you are using the Version Control
Add-In and some of the selected controlled units have not been added
to version control from within Rose. For example, if they have been
added to version control from outside Rose, or if they have not been
added to version control at all. To be able to perform the Version
Control commands on those controlled units, you must first associate
them with their version control project from within Rose, by using the
Add to Version Control command.

Can I load units which have been controlled outside Rose?

Only if you are using the ClearCase Add-In. You can load such units
provided they are checked out. If you try to load a unit which is
checked in, you will be prompted to check out the unit.

I get the error message The file x.cat could not be mapped to the
SourceSafe project /$y when trying to add a package to source
control. What is wrong?

This error message is displayed if a selected controlled unit is located


in a folder other than the selected project’s working folder. To move the
unit to the correct folder, select the unit in a diagram and click
Save…As on the File menu’s Units menu. Select the folder that
corresponds to the project where the unit is to be controlled. Then
perform the Add to Version Control command again.

294 Rational Rose 2000, Using Rose


Frequently Asked Questions About Version Control Add-Ins

I get the error message You can only add files to source control
that are located in a ClearCase view when trying to add a package
to source control. What is wrong?

This error message is displayed if a selected controlled unit is located


in a folder that is not part of a ClearCase VOB, being accessed via the
ClearCase view. To move the unit to the correct folder, select the unit
in a diagram and click Save…As on the File menu’s Units menu. Select
the folder where the unit is to be controlled. Then perform the Add to
Version Control command again.

How can I change the current version control provider?

The Version Control Add-In automatically determines which version


control system to integrate with. The Version Control Provider box in
the Version Control Options dialog box displays the name of that
version control system. The only way to change that value is to install
(or reinstall) the version control system that you want to use.

Every time I use a Version Control command, the Microsoft Visual


SourceSafe login dialog box is displayed. Why?

This dialog box is displayed if the current user name—that is, the user
that you are logged in as—is not defined in Microsoft Visual
SourceSafe. The current user name is displayed in the Version Control
Options dialog box. To disable the login dialog box, the system
administrator must enter you as a user in SourceSafe.

Can the top-level Use Case, Logical View, and Component View
units be controlled?

No. However, you can control all of the following:


■ Model file (.mdl)
■ Logical and usecase packages(.cat files)
■ Component packages (.sub file)
■ Deployment diagram (.prc file)
■ Model properties (.prp file)
■ Generated Ada and C++ files (.h, .cpp, and .ada files)

Rational Rose 2000, Using Rose 295


Chapter 18 Version Control Add-Ins

I am using ClearCase. Do I have to create the VOB and view from


within ClearCase?

Yes. You must create them externally; you cannot create them from
within Rose.

Does the ClearCase Add-In have any support for the files generated
by language add-ins?

Yes. You can use the ClearCase Add-In to manage files generated by the
C++ and Ada add-ins.

296 Rational Rose 2000, Using Rose


Chapter 19

Model Integrator

The Rose Model Integrator lets you compare model elements from up
to seven contributor files, discover their differences, and merge them
into the base model. The base model should be the common ancestor
of the contributors files
The files you compare can be:
■ Multiple versions of the base model
■ Sets of subunit files (.cat, .sub, .pty, .prc, .prp)
Note: The file extension of all contributor files must be the same during
a single compare or merge operation. In other words, you must compare
.cat files to .cat files, .sub files to .sub files, and so on.
For example, a team of developers may be working on different model
components that reside in separate .cat files. Periodically, these
developers can use the Model Integrator to merge their components
into a base model. Or, if more than one developer is working on the
same components in a model, they can use the Model Integrator to
compare any differences between their model versions and merge their
changes as appropriate.
Note: The Model Integrator merges differences between model files that
have a common ancestor. This common ancestor is also called the base
model. Merging models that do not have a common ancestor will result
in errors and unpredictable results.

Rational Rose 2000, Using Rose 297


Chapter 19 Model Integrator

Comparing or Merging Contributor Files


When you are comparing or merging contributors, you must always
specify at least 3 files: the base model plus two additional contributor
models. The maximum number of files you can specify for a single
compare or merge operation is 7. The changes you accept from
contributor files will be merged into the base model you specify.
Use the following general process to compare or merge contributor files
into a base model.
1. In Rose, select Tools > Model Integrator.
2. Select File > Contributors.
3. Enter or select the files to compare.
4. Click the Compare or Merge button.
5. If you get the Subunits dialog, load or unload the appropriate
units. (See Loading and Unloading Subunits for details.)
6. When the results of the Compare or Merge are displayed, accept
changes into the base model, as appropriate.
Note: You can only accept changes when you are in Merge mode. If you
are in Compare mode and decide to accept changes, use the tool bar to
toggle to Merge mode. See Switching Between Compare and Merge
Mode for details.
The remainder of this chapter describes these tasks in detail.

Specifying Contributor Files


Select File > Contributors to display the Contributors dialog. Then, follow
these steps to specify the files to compare or merge:
1. Do one of the following to specify the base .mdl, .cat, .sub, .pty,
.prc, or .prp file in the files list.
❑ Enter the fully qualified file name in the blank area of the Files
list.
❑ Click the Browse button and find the file to add to the list.
2. Click outside the field or click Enter to confirm the file name.

298 Rational Rose 2000, Using Rose


Specifying Contributor Files

3. Create a new input field by clicking the New icon.


Note: Use the online help to get full explanations of this dialog box, its
buttons and controls.

Important: You must specify at least 3 files; that is, the base model
plus two more. The maximum number of files you can specify is 7.
4. Repeat steps 1 through 3 until all files are specified.

Rational Rose 2000, Using Rose 299


Chapter 19 Model Integrator

Loading and Unloading Subunits


When you are comparing or merging files, if any of the contributor files
you specify have controlled units, Model Integrator displays the
Subunits dialog box. This allows you to load or unload units before
comparing or merging your files.
You get a separate Subunits dialog box for each contributor file. When
you finish and click OK, Model Integrator presents the next Subunits
dialog box. This continues for each contributor that has subunits.
When you complete the final Subunits dialog box, Model Integrator
immediately performs the Compare or Merge operation.

For help in navigating this dialog box to specify the units you want to
load and unload, use the Model Integrator online help. It provides
detailed information for each field and control.
Note: You can also use this dialog box to set a new context for model
units, as well as to edit the model’s pathmap entries. See Setting a New
Context for Model Subunits, or the online help for details.

300 Rational Rose 2000, Using Rose


Setting a New Context for Model Subunits

Setting a New Context for Model Subunits


To select a new Context path for the current contributor’s subunits,
use the Browser in the Set New &-Context dialog box to find the drive and
folder you want, and then click OK.

Background

During a Compare or Merge, if any contributor files have subunits


(controlled units) that belong to them, you get the Subunits dialog,
which allows you to load (or refrain from loading) the units.
Within the Subunits dialog, you may wish to set a new Context path
for a contributor’s subunits, particularly if you have changed their
location to a folder other than the one represented by the & in their
Virtual Path Map definition.
If you reset this path, the actual path that the Model Integrator uses to
locate the subunits will be reset based on the new path rather than the
original path represented by the & in the Virtual Path Map.

Example

If the contributor file resides in d:\mymodel1, and if you defined a


path map symbol for the subunits that corresponds to the actual path
&\mod1subunits, then the subunits will actually reside in
d:\mymodel1\mod1subunits.
If you change the Context path for the subunits, be careful to point to
a valid location, or the Model Integrator will not be able to find the
units.

Rational Rose 2000, Using Rose 301


Chapter 19 Model Integrator

Interpreting Results and Accepting Changes

Interpreting Results
The results of a Compare or Merge are displayed in the main Model
Integrator window, as shown in the following example.

■ If you performed a Compare, there is no Recipient column. Any


differences discovered during the Compare operation are noted in
the C (compare) column.
You cannot accept changes while in Compare mode. However, if
you decide you want to accept changes after all, you can switch to
Merge mode at any time.
■ If you performed a Merge, the values of the recipient are set, except
in the case of unresolved conflicts.
The indicates an unresolved conflict. You can click any item that
shows the conflict to see more information about that conflict.

302 Rational Rose 2000, Using Rose


Interpreting Results and Accepting Changes

Differences and Conflicts


A difference is an unambiguous, non-conflicting change. A conflict is a
difference that is ambiguous.
■ In Merge mode, the Model Integrator automatically handles all
differences. However, it requires you to resolve conflicts by
selecting the contributor from which to accept changes. (You can
accept changes individually or accept all changes from the selected
contributor.)
■ In Compare mode, the Model Integrator displays every difference it
encounters, whether it is a simple difference or a conflict.
Symbols indicating the results of a Compare, appear in the C column.
The following table shows some common valid combinations of
Compare status icons and their meanings.
Note: Compare results show all differences. To view conflicts only,
switch to Merge mode

Rational Rose 2000, Using Rose 303


Chapter 19 Model Integrator

Symbols indicating the results of a Merge appear in the M column. The


following table shows the Merge status icons and their meanings.
Note: Merge results show only conflicts. To view all differences, switch
to Compare mode.

Switching Between Compare and Merge Mode


You can switch between Compare mode and Merge mode at any time.
To switch before or after performing a compare or merge operation,
click the icon that represents the mode you want.
■ Click to switch to Compare mode.

■ Click to switch to Merge mode.


You can also switch modes by selecting Compare or Merge on the Options
menu.
If you switch modes after you perform a compare or merge operation
you can change what you see and how you handle the results. Keep in
mind the following information as you view and interpret your results:
■ The Merge mode view shows only conflicts. To view all differences,
switch to Compare mode.
■ The Compare mode view is read-only and does not provide a
recipient column. If you want to accept changes to the recipient,
switch to Merge mode.

304 Rational Rose 2000, Using Rose


Interpreting Results and Accepting Changes

Accepting Changes
Follow these steps to accept changes that resolve a conflict:
1. Select the unresolved item.
2. In the toolbar, click the number of the contributor from which to
accept changes.
In the following example, the delta and minus symbols indicate that
the item NewClass was changed by one contributor and deleted by
another. Notice that NewClass is selected and button 2, indicating
Contributor 2, is depressed. Changes will be accepted from
Contributor 2

Rational Rose 2000, Using Rose 305


Appendix A

Upgrading From a Previous Release

This appendix describes procedures for converting models developed


under previous versions of Rational Rose.

Upgrading from Rational Rose 3.0 or Later


If you are upgrading from release 3.0 or later of Rational Rose for
Windows, your models are converted automatically when you open
them. When you save your model, Rational Rose asks you if you want
to save your model in the new format.

Upgrading from Releases Prior to Rational Rose 3.0


If you are upgrading from a Rational Rose release prior to 3.0, please
contact technical support for assistance.

Rational Rose 2000, Using Rose 307


Appendix B

Contacting Technical Support

This chapter describes procedures for interacting with Rational


Software Corporation’s technical support services.

When Contacting Rational Technical Support


When contacting Rational technical support, please be prepared to
supply the following information:
■ Name, telephone number, and company name
■ Computer make and model
■ Make and version number of operating system
■ Product release number
■ Your log number (if you’re calling about a previously reported
problem)
If your site has a designated, on-site support person, please try to
contact that person before contacting Rational technical support.

Rational Rose 2000, Using Rose 309


Appendix B Contacting Technical Support

How to Contact Rational Customer Support


Rational customer support can provide information and assistance by:
■ Telephone
■ Electronic Mail
■ Fax
■ Rational Web Site
Please note that all information was current at the time of printing. To
be assured of the latest information, from the Help menu, point to
Rational on the Web and select Technical Support.

Telephone and E-mail


Telephone and E-mail support is available Monday through Friday
(except holidays) in four major Rational Technical Support Call Centers
around the world. Specific call center contact information is located at
the end of this Appendix, as well as on our web site at
www.rational.com.
When contacting Technical Support through e-mail, please include the
requested information outlined in the previous section “When
Contacting Rational Technical Support,” along with a detailed
description of your problem. Upon receipt of your request, Rational
Technical Support will send you an electronic response with your Log
id # and point of contact for your issue. When sending e-mail
concerning a previously reported problem, please include in the
subject field: “re: Log XXXX,” substituting your assigned support log id
for the XXXX.

310 Rational Rose 2000, Using Rose


Fax

Fax
Rational Technical Support Engineers will sometimes ask you to fax
information to help them diagnose problems. Please mark faxes
“Attention: Technical Support” and add your fax number to the
information requested earlier.

Rational Web Site


You can also contact Rational technical support through our web site
at www.rational.com.

Rational Technical Support Call Center Contact Information


This information was accurate at the time of printing. If you experience
any difficulty contacting us using this information, please check our
web site at www.rational.com/support for the most up-to-date
information.

North America
18880 Homestead Road
Cupertino, CA 95014
Telephone: 800-433-5444 or 408-863-4000
E-mail: support@rational.com

Europe
Beechavenue 30
1119 PV Schiphol-Rijk
The Netherlands
Telephone: +31 (0)20 4546 200
E-mail: support@europe.rational.com

Rational Rose 2000, Using Rose 311


Appendix B Contacting Technical Support

Asian Pacific
Level 13, 821 Pacific Hwy
Chatswood NSW
Sydney, Australia
Telephone: +61-2-9419-0111
E-mail: support@apac.rational.com

312 Rational Rose 2000, Using Rose


Index

Symbols Application Window (continued)


+ (plus) sign 23 menu bar 8
.cat File 246 title bar 8
.mdl File 246 toolbar 8
.prc File 246 Arguments 84
.prp File 246 Assigning a Component to Another
.sub File 246 Package 174
Assigning Classes 60
Association 165
A Association Name 232
Abstract 67, 117 Association Relationships 232
accepting changes (Model Integrator) Association Specification 92
302 Detail Tab 94
Actor Specification 120 Constraints 95
Add icons to a diagram 32 Derived 95
Add-In Link Element 95
Installing 5 Name Direction 95
Manager 5 General Tab 93
Adding Element 94
Classes 60 Parent 93
Stereotypes to the Diagram Toolbox Role 94
226 Stereotype 93
Add-Ins 5 Role A and B Detail Tab 97
Adorning the Diagrams 45 Aggregate 98
Aggregate 98 Containment 98
Aggregation 232 Friend 98
Application Window 8 Keys/Qualifiers 99
documentation window 8 Navigable 97
maximize button 8 Static 98
Role A and B General Tab 96

Rational Rose 2000, Using Rose 313


Index

Attributes 230 Checking Out 285


Class 79, 162, 164, 170
Class Attribute Specification 78
B Detail Tab 80
Browse Containment 80
Class Diagram 11 Derived 81
Component Diagram 11 Static 81
Deployment Diagram 11 General Tab 78
Interaction Diagram 11 Class 79
Parent 11 Initial Value 79
Previous Diagram 12 Show Classes 79
State Machine Diagram 11 Type-Class Attribute 79
Browser 21, 22, 23 Class Diagram 11, 57
Collapsing 23 Creating 59
Creating Icons 225 Displaying 59
Docked 22 Re-assign a class 60
Docking 23 Toolbox 59
Drag-and-Drop 26 Class Instance Specification 163
Hiding 22 General Tab 163
Hiding and Displaying 22 Class 164
Naming an Element 26 Class Specification 61
Navigating 24 Attributes Tab 71
Redock 23 Detail Tab 64
Undocking 23 Abstract 67
Version Control Icons 246, 258 Cardinality 65
Viewing 22 Concurrency 67
Browser to Browser Capabilities 27 Formal Arguments 68
Browser to Diagram Capabilities 28 Persistence 66
Browser to Specification Capabilities 29 Space 65
Browser Tree Files Tab 77
Collapsing 23 General Tab 62
Expanding 23 Export Control 63
Browsing a Model in Visual Component Parent 62
Manager 242 Stereotype 63
Type 62
Operation Tab 68
C Show Inherited 70
Cardinality 65 Relations Tab 73
Change the default font parameters 45 Classes 179, 229
Characteristics 186
CheckConstraint 231
Checking In 287

314 Rational Rose 2000, Using Rose


Index

ClearCase Component Specification (continued)


Checking Out 285, 287 Realizes Tab 178
Controlled Units 252 Classes 179
Getting Latest Version 289 Language 179
Importing Units 265 Show all Classes 179
Integrating With 252 CompositeUnique 231
Integration Strategy 272 Concurrency 67, 86
Merging Units 264 Connection Specification 189
Removing Unit 289 Connections 183
Splitting Unit 262 Constraints 95
Undoing Check-Out 288 Containment 80, 98
Using Rose in a Team 272 context path for model subunits 301
Virtual Path Maps 268 Context Sensitive Help 10
Working in a Team 245 Controlled Units 246
Client Visibility 166 Browsing 258
CM Menu 252 Checking In 287
CM Systems 252 Checking Out 285
coclass 203 Creating 256
Collaboration 145 Creating of Model Properties
Collaboration Diagram 146 Model Properties
Create 159 Creating Controlled Unit 267
Toolbox 147 Getting Latest 289
ColumnType 231 Icons 258
COM components 199 Importing 265
COM Properties dialog box 213 Loading 260
Common Specification Elements 49 Merging 264
comparing contributors, Model Modifying 261
Integrator 298 Organizing a Model 253
Component Diagram 11, 181 Removing Units 289
Creating 174 Saving
Displaying 174 Saving
Toolbox 174 Controlled Units 261
Component Name 75 Splitting 262
Component Package 256 Status 258
Component Specification 175 Uncontrolling 262
Detail Tab 177 Undoing Check-Out 288
Declarations 178 Unloading 260
General Tab 176 Virtual Path Maps
Language 176 Virtual Path Maps 268
Stereotype 176 Working With 252
Write Protection 248, 265

Rational Rose 2000, Using Rose 315


Index

Controlling the Model Properties 267 Default Font Parameters


Control-Menu Box 8 Changing 45
Copy 10 Delete 42
Correlation 43, 44 From Model 42
Bending 44 Icons 42
Changing the Name 45 Deleting 42
Reconnecting 44 Controlled Unit 262
Creating Dependency Specification 101
Alternative Diagrams 159 General Tab 101
Collaboration Diagram from a Deployment Diagram 11, 183
Sequence Diagram 159 Creating 184
Component Diagram 174 Displaying 184
Diagram Icon 224 Toolbox 184
Elements 37 Version Control 246
Icons for the Diagram Toolbox or Derived 81, 95
Browser 225 Deselecting Icons 41
Icons on a diagram 32 Detail Tab 51
Model Elements 25 Device Specification 188
New Model 9 Detail Tab 189
New Stereotype Configuration File General Tab 188
221 Devices 183
Overloaded Element on the Diagram Diagram 105, 118
39 Adorning 45
Sequence Diagram from a Creating 34, 159
Collaboration Diagram 160 Deleting 36
Creating Controlled Unit 256 Displaying 35
Creating Diagram Toolbox and List View Placing Text 45
Icons 225 Renaming 36
Creating Model Elements 37 Diagram Icon 224
Cut 10 Diagram Toolbox
Adding Stereotypes 226
Creating Icons 225
D Diagram Window 31, 32
Data Definition Language 227 Diagrams 118
Data Model 227 Dialog Boxes 49
DataBase 236 differences and conflicts (Model
DDL 227 Integrator) 303
Generation 236 dispinterface 203
Script File Name 237 Displaying 22
Three Schema Model 228 Browser 22
Declarations 178 Multiple Diagrams 33
Specifications 47

316 Rational Rose 2000, Using Rose


Index

Dividing Controlled Unit 262 Friend 98


Docked 22 Friendship Required 100, 120
Documentation 50 full import 212
Documentation Window 8 Fully Qualified Names 40
Drag-and-Drop 21, 25, 26
DropClause 237
G
Generalize Specification 99
E General Tab 100, 119
Editing Model Elements 25 Friendship Required 100, 120
Elements 94 Virtual Inheritance 100, 120
Entity Design 227 Generating DDL 237
Entity-Relationship 227 Getting Latest Version of Unit 289
Exceptions 85 Global 104
Expanding 23
Export Control 63
Exporting a Model 240, 241 H
Extending Rose 5 Has Relationship 105
Has Specification 105
Detail Tab 107
F General Tab 106
Features 4 Hide Stereotype Name 221
File Paths in Model 268 Hiding Classes 60
Files Tab 51, 77 Hiding the Browser 22
Filtering Class Relationships 60
Fit in Window 12
Floating 22 I
Focus of Control Icons 168
Diagrams 163 Copying 42
Scripts 156 Cutting 42
Font 45 Deleting 42
Formal Arguments 68 Pasting 42
Framework 193 Importing a Model 241, 243
Activating the Framework Wizard importing a type library 208
Add-In 193 Importing Controlled Units 265
Changing 198 Importing Model Elements 243
Creating a Model from a Framework Inheritance 234
194 InheritSuffix 237
Creating a New Framework 195 Initial Value 79
Deleting 198 Installing an Add-In 5
Framework Library 195 Integrating Rose with CM System 252
Frequency 172 Integrating With 252

Rational Rose 2000, Using Rose 317


Index

Integrating with CM System 252 Logical Package Specification 102


Integrating with Rose 252 Logical Views 229
Integration Strategy 272 Attributes 230
Interaction Diagram 11, 87, 88, 89, 145 Classes 229
interface Package 229
in type library 203
of COM component 203
interpreting results (Model Integrator) M
302 Manipulating Icons 41
Manipulating Text 42
Maximize Button 8
K Menu Bar 8
Keys 99, 233 Menu Control Box 8
merging contributors (Model Integrator)
298
L Merging Controlled Units 264
Language 75, 176, 179 Message Name 169
Length 231 Message Specification 169
Link a Diagram 35 Detail Tab 171
Link Classes 234 Frequency 172
Link Element 95 Synchronization 172
Link Specification 164 General Tab 170
General Tab 165 Class 170
Association 165 Messages 151
Roles 167 Microsoft Repository 239
Shared 167 Microsoft Visual Component Manager
Messages Tab 168 239
Icon 168 Minimize Button 8
Message Name 169 Model
Receiver 169 Navigating 24
Sequence 168 Organizing in Controlled Units 253
Linking 34 Version Control 246
Loading Controlled Units 260 Model Elements 37
loading subunits 300 Creating 25
Logical Package 256 Editing 25
Assigning 60 Model Integrator 297
Checking In 287 Model Properties
Checking Out 285 Version Control 246
Getting Latest Version 289 Modifying
Removing Controlled Unit 289 Controlled Units 261
Undoing Check-Out 288 Moving Icons 42
Version Control 246 Multiple Instances Check Box 162

318 Rational Rose 2000, Using Rose


Index

Multiple Objects 151 Operation Specification 82


Multiplicity 232 Detail Tab 84
Multiuser Support 245 Arguments 84
Controlled Units 252 Concurrency 86
Integrating with CM System 252 Exceptions 85
Integration Strategy 272 Protocol 85
Using Rose in a Team 272 Qualifications 85
Virtual Path Maps 268 Size 85
Time 85
Files Tab 90
N General Tab 83
Name 116 Return Class 83
Name Direction 95 Post Conditions Tab 89
Naming 44 Interaction Diagram 89
an Element on the Diagram 38 Postconditions Tab
an Overloaded Element on the Postcondition 89
Diagram 39 Pre Condition Tab
Element 26 Pre Conditions 87
Element in the Browser 26 Pre Conditions Tab 87
Model Elements 37 Pre Conditions 87
Naming Model Elements 37 Semantics Tab 88
Navigability 232 Interaction Diagram 87, 88
Navigable 97 Semantics 88
Navigating a Model 24 Overloaded Element 39
Navigating the Tabs 54 Overloading 38
Adding and Deleting Entries 54
Editing Entries 54
Notations 4 P
NullsOK 231 Package 62, 117, 181, 229
Checking In 287
Checking Out 285
O Creating Controlled Unit 256
Object Browser in Visual Basic 207 Getting Latest Version 289
Object Identifiers 228 Removing Controlled Unit 289
Object Models 228 Undoing Check-Out 288
Object Orientation with Databases 228 Version Control 246
Object Specification 160 Package Name 75
General Tab 161
Class 162
Persistence Field 162
OLE Viewer 206
Open Existing Model 10

Rational Rose 2000, Using Rose 319


Index

Package Specification 180 Q


Detail Tab 104, 181
Qualifications 85
Component Diagram 181
Qualifiers 99
Diagram 105
quick import 212
Global 104
General Tab 103, 180
Package 181 R
Parent 11, 62, 93 Rank 117
Paste 10 Rational ClearCase 252
Path Maps 268 Checking In 287
Persistence 66 Checking Out 285
Persistence Field 162 Controlled Units 252
Positioning 22 Getting Latest Version 289
Postcondition 89 Importing Units 265
PreConditions 87 Integration Strategy 272
Previous Diagram 12 Merging Units 264
PrimaryKey 231 Removing Unit 289
PrimaryKeyColumnKey 236 Splitting Unit 262
PrimaryKeyColumnType 236 Undoing Check-Out 288
Print Diagrams 10 Using Rose in a Team 272
Priority 191 Virtual Path Maps 268
Private 63 Working in a Team 245
Process Specification 190 Rational Rose
General Tab 190 Status Bar 248
Priority 191 Reassigning Model Elements 40
Processor 191 Receiver 169
Processes 187 Relations 119
Processor 183, 191 Removing
Processor Specification 184 Controlled Unit 262
Detail Tab 186 Removing from Version Control 289
Characteristics 186 Renaming Model Elements 40
Processes 187 Repository Add-In 239
Scheduling 187 Activating the Repository Add-In 240
General Tab 185 Resizing an Icon 41
Protected 63 Return Class 83
Protocol 85 Role 94, 167
Public 63
Publishing a Model 240, 241
PVCS 252 S
Save Model or Log 10
Scheduling 187
Schema 227

320 Rational Rose 2000, Using Rose


Index

Scripts 163 Specification (continued)


Create 156 Operation 82
Delete 157 Package 180
Detach 156 Process 190
Move 156 Processor 184
Undo 157 Tab Buttons 53
Semantics 88 Apply 53
Sequence 168 Browse 53
Sequence Diagram 147 Cancel 53
Toolbox 159 Help 54
Shared 167 OK 53
Show all Classes 179 specifying files to compare or merge
Show Classes 79 (Model Integrator) 298
Show labels 220 Splitting Controlled Unit 262
Show Stereotype Names 220 State Machine Diagram 11
Show Stereotypes 219 State Transition Specification
Size 85 Detail Tab
Snap-to-grid 42 Transition Between Substates
Space 65 139
Specification Static 81, 98
Actor 120 Status Bar 248
Association 92 Status Icons 258
Class 61 Stereotype 63, 93, 176, 217, 221
Class Attribute 78 Benefits 217
Class Instance 163 Creating 221
Component 175 Creating Configuration File 221
Connection 189 Creating Icons 224
Dependency 101 Display 219
Detail Tab 51 Icon 224
Device 188 User-Defined 218
Dialog Boxes 49 Viewing 219
Displaying 47 Subunits 246
Files Tab 51 Supplier Visibility 166
General Tab symbols (Model Integrator) 303
Documentation 50 Synchronization 172
Name 50
Generalize 99
Has 105
Link 164
Logical Package 102
Message 169
Object 160

Rational Rose 2000, Using Rose 321


Index

T Upgrading 307
URLs 52
Tab Buttons 53
Use Case Package
Apply 53
Version Control
Browse 53
Component Package
Cancel 53
Help 54 Version Control 246
OK 53 Use-Case Specification
TableName 236 Diagram Tab 117
Tabs Diagram 118
Navigating 54 General Tab
Team Development 245, 252 Abstract 117
Controlled Units 246, 252 Package 117
Integration Strategy 272 Rank 117
Using Rose in a Team 272 Relations Tab 118
Virtual Path Maps 268 Relations 119
Three Schema Architecture 228 User Case Package 256
Time 85 User Interface 5
Title Bar 8 User-Defined 218
Toolbar 8, 34
Toolbox V
Class Diagram 59
Collaboration Diagram 147 Version Control 246
Component Diagram 174 Checking In 287
Deployment Diagram 184 Checking Out 285
Sequence Diagram 159 Getting Latest Version 289
Transition Between Substates 139 of Model Properties 267
Type 62 Removing Units 289
type libraries 199 Team Development 245
Type Library Importer 199 Undoing Check Out 288
Type-Class Attribute 79 Using Rose in a Team 272
Version Control Add-In 252, 268
Checking In 287
U Checking Out 285
Uncontrolling Controlled Units 262 Controlled Units 252
Undo Fit in Window 12 Current SCC Provider 291
Undock 23 Getting Latest 289
Undoing Check-Out 288 Importing Units 265
Unique 231 Log 291
Units 246 Merging Units 264
Unloading Controlled Units 260 Removing Unit 289
unloading subunits 300 Splitting Units 262
Undoing Check-Out 288

322 Rational Rose 2000, Using Rose


Index

Version Control Add-In (continued)


User Name 291
Version Control Options 291
Version Control Icons 258
Version Control Options Dialog Box 291
Version Control Systems 252
Viewing
Diagrams 32
Documentation 11
Name 236
Virtual Inheritance 100, 120
Virtual Path Maps 268
Visibility 166
Visual Component Manager 239

W
When 300
Write Protection 248, 265

Z
Zoom In/Out 12

Rational Rose 2000, Using Rose 323

You might also like