- •Table of Contents
- •Mastering UML with Rational Rose 2002
- •Chapter 1: Introduction to UML
- •Encapsulation
- •Inheritance
- •Polymorphism
- •What Is Visual Modeling?
- •Systems of Graphical Notation
- •Booch Notation
- •Object Management Technology (OMT)
- •Unified Modeling Language (UML)
- •Understanding UML Diagrams
- •Business Use Case Diagrams
- •Use Case Diagrams
- •Activity Diagrams
- •Sequence Diagrams
- •Collaboration Diagrams
- •Class Diagrams
- •Statechart Diagrams
- •Component Diagrams
- •Deployment Diagrams
- •Visual Modeling and the Software Development Process
- •Inception
- •Elaboration
- •Construction
- •Transition
- •Summary
- •Chapter 2: A Tour of Rose
- •What Is Rose?
- •Getting Around in Rose
- •Parts of the Screen
- •Exploring Four Views in a Rose Model
- •Use Case View
- •Logical View
- •Component View
- •Deployment View
- •Working with Rose
- •Creating Models
- •Saving Models
- •Exporting and Importing Models
- •Publishing Models to the Web
- •Working with Controlled Units
- •Using the Model Integrator
- •Working with Notes
- •Working with Packages
- •Adding Files and URLs to Rose Model Elements
- •Adding and Deleting Diagrams
- •Setting Global Options
- •Working with Fonts
- •Working with Colors
- •Summary
- •Chapter 3: Business Modeling
- •Introduction to Business Modeling
- •Why Model the Business?
- •Do I Need to Do Business Modeling?
- •Business Modeling in an Iterative Process
- •Business Actors
- •Business Workers
- •Business Use Cases
- •Business Use Case Diagrams
- •Activity Diagrams
- •Business Entities
- •Organization Unit
- •Where Do I Start?
- •Identifying the Business Actors
- •Identifying the Business Workers
- •Identifying the Business Use Cases
- •Showing the Interactions
- •Documenting the Details
- •Creating Business Use Case Diagrams
- •Deleting Business Use Case Diagrams
- •The Use Case Diagram Toolbar
- •Adding Business Use Cases
- •Business Use Case Specifications
- •Assigning a Priority to a Business Use Case
- •Viewing Diagrams for a Business Use Case
- •Viewing Relationships for a Business Use Case
- •Working with Business Actors
- •Adding Business Actors
- •Adding Actor Specifications
- •Assigning an Actor Stereotype
- •Setting Business Actor Multiplicity
- •Viewing Relationships for a Business Actor
- •Working with Relationships
- •Association Relationship
- •Generalization Relationship
- •Working with Organization Units
- •Adding Organization Units
- •Deleting Organization Units
- •Activity Diagrams
- •Adding an Activity Diagram
- •Adding Details to an Activity Diagram
- •Summary
- •Chapter 4: Use Cases and Actors
- •Use Case Modeling Concepts
- •Actors
- •Use Cases
- •Traceability
- •Flow of Events
- •Relationships
- •Use Case Diagrams
- •Activity Diagrams
- •Activity
- •Start and End States
- •Objects and Object Flows
- •Transitions
- •Synchronization
- •Working with Use Cases in Rational Rose
- •The Use Case Diagram Toolbar
- •Creating Use Case Diagrams
- •Deleting Use Case Diagrams
- •Adding Use Cases
- •Deleting Use Cases
- •Use Case Specifications
- •Naming a Use Case
- •Viewing Participants of a Use Case
- •Assigning a Use Case Stereotype
- •Assigning a Priority to a Use Case
- •Creating an Abstract Use Case
- •Viewing Diagrams for a Use Case
- •Viewing Relationships for a Use Case
- •Working with Actors
- •Adding Actors
- •Deleting Actors
- •Actor Specifications
- •Naming Actors
- •Assigning an Actor Stereotype
- •Setting Actor Multiplicity
- •Creating an Abstract Actor
- •Viewing Relationships for an Actor
- •Viewing an Actor's Instances
- •Working with Relationships
- •Association Relationship
- •Includes Relationship
- •Extends Relationship
- •Generalization Relationship
- •Working with Activity Diagrams
- •The Activity Diagram Toolbar
- •Creating Activity Diagrams
- •Deleting Activity Diagrams
- •Exercise
- •Problem Statement
- •Create a Use Case Diagram
- •Summary
- •Chapter 5: Object Interaction
- •Interaction Diagrams
- •What Is an Object?
- •What Is a Class?
- •Where Do I Start?
- •Finding Objects
- •Finding the Actor
- •Using Interaction Diagrams
- •Sequence Diagrams
- •The Sequence Diagram Toolbar
- •Collaboration Diagrams
- •The Collaboration Diagram Toolbar
- •Working with Actors on an Interaction Diagram
- •Working with Objects
- •Adding Objects to an Interaction Diagram
- •Deleting Objects from an Interaction Diagram
- •Setting Object Specifications
- •Naming an Object
- •Mapping an Object to a Class
- •Setting Object Persistence
- •Using Multiple Instances of an Object
- •Working with Messages
- •Adding Messages to an Interaction Diagram
- •Adding Messages to a Sequence Diagram
- •Deleting Messages from a Sequence Diagram
- •Reordering Messages in a Sequence Diagram
- •Message Numbering in a Sequence Diagram
- •Viewing the Focus of Control in a Sequence Diagram
- •Adding Messages to a Collaboration Diagram
- •Deleting Messages from a Collaboration Diagram
- •Message Numbering in a Collaboration Diagram
- •Adding Data Flows to a Collaboration Diagram
- •Setting Message Specifications
- •Naming a Message
- •Mapping a Message to an Operation
- •Setting Message Synchronization Options
- •Setting Message Frequency
- •End of a Lifeline
- •Working with Scripts
- •Switching Between Sequence and Collaboration Diagrams
- •Exercise
- •Problem Statement
- •Create Interaction Diagrams
- •Summary
- •Chapter 6: Classes and Packages
- •Logical View of a Rose Model
- •Class Diagrams
- •What Is a Class?
- •Finding Classes
- •Creating Class Diagrams
- •Deleting Class Diagrams
- •Organizing Items on a Class Diagram
- •Using the Class Diagram Toolbar
- •Working with Classes
- •Adding Classes
- •Class Stereotypes
- •Analysis Stereotypes
- •Class Types
- •Interfaces
- •Web Modeling Stereotypes
- •Other Language Stereotypes
- •Class Specifications
- •Naming a Class
- •Setting Class Visibility
- •Setting Class Multiplicity
- •Setting Storage Requirements for a Class
- •Setting Class Persistence
- •Setting Class Concurrency
- •Creating an Abstract Class
- •Viewing Class Attributes
- •Viewing Class Operations
- •Viewing Class Relationships
- •Using Nested Classes
- •Viewing the Interaction Diagrams That Contain a Class
- •Setting Java Class Specifications
- •Setting CORBA Class Specifications
- •Working with Packages
- •Adding Packages
- •Deleting Packages
- •Exercise
- •Problem Statement
- •Creating a Class Diagram
- •Summary
- •Chapter 7: Attributes and Operations
- •Working with Attributes
- •Finding Attributes
- •Adding Attributes
- •Deleting Attributes
- •Setting Attribute Specifications
- •Setting the Attribute Containment
- •Making an Attribute Static
- •Specifying a Derived Attribute
- •Working with Operations
- •Finding Operations
- •Adding Operations
- •Deleting Operations
- •Setting Operation Specifications
- •Adding Arguments to an Operation
- •Specifying the Operation Protocol
- •Specifying the Operation Qualifications
- •Specifying the Operation Exceptions
- •Specifying the Operation Size
- •Specifying the Operation Time
- •Specifying the Operation Concurrency
- •Specifying the Operation Preconditions
- •Specifying the Operation Postconditions
- •Specifying the Operation Semantics
- •Displaying Attributes and Operations on Class Diagrams
- •Showing Attributes
- •Showing Operations
- •Showing Visibility
- •Showing Stereotypes
- •Mapping Operations to Messages
- •Mapping an Operation to a Message on an Interaction Diagram
- •Exercise
- •Problem Statement
- •Add Attributes and Operations
- •Summary
- •Chapter 8: Relationships
- •Relationships
- •Types of Relationships
- •Finding Relationships
- •Associations
- •Using Web Association Stereotypes
- •Creating Associations
- •Deleting Associations
- •Dependencies
- •Creating Dependencies
- •Deleting Dependencies
- •Package Dependencies
- •Creating Package Dependencies
- •Deleting Package Dependencies
- •Aggregations
- •Creating Aggregations
- •Deleting Aggregations
- •Generalizations
- •Creating Generalizations
- •Deleting Generalizations
- •Working with Relationships
- •Setting Multiplicity
- •Using Relationship Names
- •Using Stereotypes
- •Using Roles
- •Setting Export Control
- •Using Static Relationships
- •Using Friend Relationships
- •Setting Containment
- •Using Qualifiers
- •Using Link Elements
- •Using Constraints
- •Exercise
- •Problem Statement
- •Adding Relationships
- •Summary
- •Chapter 9: Object Behavior
- •Statechart Diagrams
- •Creating a Statechart Diagram
- •Adding States
- •Adding State Details
- •Adding Transitions
- •Adding Transition Details
- •Adding Special States
- •Using Nested States and State History
- •Exercise
- •Problem Statement
- •Create a Statechart Diagram
- •Summary
- •Chapter 10: Component View
- •What Is a Component?
- •Types of Components
- •Component Diagrams
- •Creating Component Diagrams
- •Adding Components
- •Adding Component Details
- •Adding Component Dependencies
- •Exercise
- •Problem Statement
- •Summary
- •Chapter 11: Deployment View
- •Deployment Diagrams
- •Opening the Deployment Diagram
- •Adding Processors
- •Adding Processor Details
- •Adding Devices
- •Adding Device Details
- •Adding Connections
- •Adding Connection Details
- •Adding Processes
- •Exercise
- •Problem Statement
- •Create Deployment Diagram
- •Summary
- •Chapter 12: Introduction to Code Generation and Reverse Engineering Using Rational Rose
- •Preparing for Code Generation
- •Step One: Check the Model
- •Step Two: Create Components
- •Step Three: Map Classes to Components
- •Step Five: Select a Class, Component, or Package
- •Step Six: Generate Code
- •What Gets Generated?
- •Introduction to Reverse Engineering Using Rational Rose
- •Model Elements Created During Reverse Engineering
- •Summary
- •Chapter 13: ANSI C++ and Visual C++ Code Generation and Reverse Engineering
- •Generating Code in ANSI C++ and Visual C++
- •Converting a C++ Model to an ANSI C++ Model
- •Class Properties
- •Attribute Properties
- •Operation Properties
- •Package (Class Category) Properties
- •Component (Module Specification) Properties
- •Role Properties
- •Generalization Properties
- •Class Model Assistant
- •Component Properties
- •Project Properties
- •Visual C++ and ATL Objects
- •Generated Code
- •Code Generated for Classes
- •Code Generated for Attributes
- •Code Generated for Operations
- •Visual C++ Code Generation
- •Reverse Engineering ANSI C++
- •Reverse Engineering Visual C++
- •Summary
- •Overview
- •Introduction to Rose J
- •Beginning a Java Project
- •Selecting a Java Framework
- •Linking to IBM VisualAge for Java
- •Linking to Microsoft Visual J++
- •Project Properties
- •Class Properties
- •Attribute Properties
- •Operation Properties
- •Module Properties
- •Role Properties
- •Generating Code
- •Generated Code
- •Classes
- •Attributes
- •Operations
- •Bidirectional Associations
- •Unidirectional Associations
- •Associations with a Multiplicity of One to Many
- •Associations with a Multiplicity of Many to Many
- •Reflexive Associations
- •Aggregations
- •Dependency Relationships
- •Generalization Relationships
- •Interfaces
- •Java Beans
- •Support for J2EE
- •EJBs
- •Servlets
- •JAR and WAR Files
- •Automated J2EE Deployment
- •Reverse Engineering
- •Summary
- •Starting a Visual Basic Project
- •Class Properties
- •Attribute Properties
- •Operation Properties
- •Module Specification Properties
- •Role Properties
- •Generalization Properties
- •Generated Code
- •Classes
- •Attributes
- •Operations
- •Bidirectional Associations
- •Unidirectional Associations
- •Associations with a Multiplicity of One to Many
- •Associations with a Multiplicity of Many to Many
- •Reflexive Associations
- •Aggregations
- •Dependency Relationships
- •Generalization Relationships
- •Reverse Engineering
- •Summary
- •Overview
- •Introduction to XML DTD
- •Elements
- •Attributes
- •Entities and Notations
- •Project Properties
- •Class Properties
- •Attribute Properties
- •Role Properties
- •Component Properties
- •Generating Code
- •Generated Code
- •Classes
- •Attributes
- •Reverse Engineering DTD
- •Summary
- •Project Properties
- •Class Properties
- •Attribute Properties
- •Operation Properties
- •Module Properties
- •Association (Role) Properties
- •Dependency Properties
- •Generated Code
- •Classes
- •Attributes
- •Operations
- •Bidirectional Associations
- •Unidirectional Associations
- •Associations with a Multiplicity of One to Many
- •Associations with a Multiplicity of Many to Many
- •Associations with Bounded Multiplicity
- •Reflexive Associations
- •Aggregations
- •Dependency Relationships
- •Generalization Relationships
- •Reverse Engineering CORBA Source Code
- •Summary
- •Chapter 18: Rose Data Modeler
- •Object Models and Data Models
- •Creating a Data Model
- •Logic in a Data Model
- •Adding a Database
- •Adding Tablespaces
- •Adding a Schema
- •Creating a Data Model Diagram
- •Creating Domain Packages and Domains
- •Adding Tables
- •Adding Columns
- •Setting a Primary Key
- •Adding Constraints
- •Adding Triggers
- •Adding Indexes
- •Adding Stored Procedures
- •Adding Relationships
- •Adding Referential Integrity Rules
- •Working with Views
- •Generating an Object Model from a Data Model
- •Generating a Data Model from an Object Model
- •Generating a Database from a Data Model
- •Updating an Existing Database
- •Reverse Engineering a Database
- •Summary
- •Chapter 19: Web Modeling
- •Modeling a Web Application
- •Web Class Stereotypes
- •Relationships
- •Reverse Engineering a Web Application
- •Generating Code for a Web Application
- •Summary
- •Appendix: Getting Started with UML
- •Building a Business Use Case Diagram
- •Building a Workflow (Activity) Diagram
- •Building a Use Case Diagram
- •Building an Interaction Diagram
- •Building a Class Diagram
- •Web Modeling
- •Adding Class Relationships
- •Building a Statechart Diagram
- •Building a Component Diagram
- •Building a Deployment Diagram
Appendix: Getting Started with UML
UML is made up of a number of different types of diagrams. Each gives the reader a slightly different perspective of the system's design. Some are high−level and intended to give you an understanding of the functionality in the system. Others are very detailed and include the specific classes and components that will be built to implement the system. Still others are midway between these two levels: They provide design details but from a higher−level perspective.
The set of diagrams gives you a complete picture of the system design. Different members of the team create different types of diagrams, and each is used by a different set of people. While building the system, the developers will refer to the diagrams to understand what classes and components need to be built. Later, when a team is maintaining the system, they can refer to the diagrams to understand the system structure, analyze the impact of a potential change, and document any design changes that were made.
UML is constantly being refined to incorporate new ideas and technologies. For example, it can now be used to model an XML DTD. As the object−oriented world changes, UML can change along with it. At the same time, though, it is a standard, and modifications to it are centrally managed. UML is controlled by the Object Management Group, which has members from large and small companies around the world.
Rational Software has developed a systems development lifecycle titled the Rational Unified Process (RUP). RUP complements UML by providing specific process steps, roles, responsibilities, guidelines, workflows, and templates that can be used to develop software. Although RUP complements UML, you may use UML without using RUP.
UML includes many different diagram types. Business Use Case diagrams are used to model the organization. Business workflow (activity) diagrams are used to show the processes within the organization. Use Case diagrams show the functionality to be provided by the system and the people and entities that interact with the system. Activity diagrams show the flow of logic through a use case. Sequence and Collaboration diagrams show the objects that are needed to implement the functionality of a use case, and include the messages between the objects. Statechart diagrams are used to model dynamic behavior, and are frequently used in real−time systems. Component diagrams show the components that will be created for the system and the relationships between them. Finally, Deployment diagrams are used to show the network structure and where the system will be deployed on the network.
Building a Business Use Case Diagram
A Business Use Case diagram is a mechanism for modeling the work done by the organization itself. The diagram contains business use cases, which are functions performed by the organization; business actors, which are entities outside the organization that interact with it; and business workers, which are roles within the organization.
The Business Use Case diagram gives someone an understanding of what the organization does and who interacts with it. It is supplemented by activity diagrams, which detail the workflows within the organization.
A business process team or a business analysis team typically creates the diagram. It is nontechnical, and can be used by any member of the organization to gain a better understanding of the organization.
To create a new Business Use Case diagram, follow these steps:
1.
672
Appendix: Getting Started with UML
Right−click a package in the Use Case view.
2.
Select New → Use Case Diagram.
3.
Right−click the toolbar and select Customize.
4.
Add buttons for business actor, business use case, business worker, business entity, and organizational unit.
A Business Use Case diagram shows a subset of the business use cases, business workers, and business actors of the organization.
Follow these steps to add business actors to your diagram:
1.
Determine the business actors.
2.
Select the Business Actor toolbar button.
3.
Click in the Use Case diagram to add the actor.
4.
Name the actor.
A business actor is an individual, group, company, or other entity outside of the organization that directly interacts with the organization.
673
Appendix: Getting Started with UML
Use these steps to add business workers to the diagram:
1.
Determine the business workers.
2.
Select the Business Worker toolbar button.
3.
Click in the Use Case diagram to add the worker.
4.
Name the worker.
A business worker is a role within the organization.
Follow these steps to add relationships between the business actors and business use cases:
1.
Select the Unidirectional Association toolbar button.
2.
Drag an arrow from the actor or business worker to the use case.
A communicates relationship between a business actor and a business use case shows how a business actor or business worker interacts with the organization.
Follow these steps to group the business actors, business workers, and business use cases into organization units.
1.
Select the Organization Unit toolbar button.
2.
Click inside a Business Use Case diagram to place the organization unit.
3.
In the browser, drag and drop business actors, business workers, business use cases, Business Use
674
Appendix: Getting Started with UML
Case diagrams, and activity diagrams into the new organization unit.
An organization unit is used to group together business modeling elements such as business actors and business use cases. These units can help to organize the model and show how the company itself is organized.
Building a Workflow (Activity) Diagram
Activity diagrams are commonly used in two situations. In business modeling, they can be used to document the workflow of a process within the organization. In systems modeling, they can be used to document the flow of logic through a use case.
An activity diagram that focuses on workflow shows you the people or groups within the workflow, the steps in the process, decision points in the process, areas where steps in the process can occur in parallel, objects affected by the workflow, states of the objects, and transitions between steps in the process. UML contains notation for all of these items.
To create a new activity diagram:
1.
Right−click a use case or package in the Use Case view.
2.
Select New → Activity Diagram.
An activity diagram models a process in the organization. It can be used to analyze either existing or new processes. These types of diagrams are frequently used in business process re−engineering efforts or in any situation where the workflow is complex or undocumented.
675
Appendix: Getting Started with UML
To partition your diagram into sections for each actor or worker's responsibilities, follow these steps:
1.
Determine the participants in the workflow.
2.
Select the Swimlane toolbar button.
3.
Click in the diagram to add the swimlane.
4.
Name the swimlane with the name of the role or group in the workflow.
A swimlane is a vertical section of the diagram that will contain all of the workflow steps that a particular person or group performs. You divide the diagram into many swimlanes, one for each person or group in the process.
676
Appendix: Getting Started with UML
To add detailed steps to the diagram:
1.
Select the Activity toolbar button.
2.
Click in the diagram to add the activity.
3.
Name the activity.
An activity is a step in the workflow. It can contain actions, which are steps within the activity. The activity is placed in the swimlane of the individual or group that performs the activity.
Follow these steps to set the sequence of the activities:
1.
Select the Transition toolbar button.
2.
Drag an arrow from one activity to the next.
3.
677
Appendix: Getting Started with UML
Right−click the transition arrow and select Open Specification.
4.
Optionally add an event and event arguments on the General tab.
5.
Optionally add a guard condition, action, send event, send event arguments, and send target on the Detail tab.
A transition shows how the process moves from one step (activity) to the next. An event triggers the movement from one activity to another. An event can have arguments. A guard condition controls when the transition can or cannot occur; the guard condition must be true for the transition to occur. An action occurs while the process is transitioning from one activity to another. It is typically a quick process that occurs as part of the transition itself. The send target suggests that, as part of the transition, a message is sent to some object. The send target is the object receiving the message. The send event is a message sent to another object. It may have arguments.
Follow these steps to add decision points to the logic:
1.
Select the Decision toolbar button.
2.
Click in the diagram to place the decision.
3.
Draw transitions from the decision to the activities that may occur after the decision.
4.
Place guard conditions on each transition arrow. The guard conditions will control which path is taken after the decision.
A decision point in the workflow indicates when the workflow can take two or more different paths. Transition arrows leading from the decision to activities show the different paths that the workflow can follow. Guard conditions on the transitions indicate under which conditions each path will be followed. Guard conditions must be mutually exclusive.
To add objects to the workflow:
1.
Select the Object toolbar button.
2.
Click inside the diagram to place the object.
3.
678