Object Modeling with OMG UML Tutorial Series

Introduction to UML: Structural and Use Case Modeling

Cris Kobryn
Co-Chair UML Revision Task Force

© 1999-2001 OMG and Contributors: Crossmeta, EDS, IBM, Enea Data, Hewlett-Packard, IntelliCorp, Kabira Technologies, Klasse Objecten, Rational Software, Telelogic, Unisys

Overview 
  

Tutorial series Quick tour Structural modeling Use case modeling

Introduction to UML

2

Tutorial Series   

Lecture 1: Introduction to UML: Structural and Use Case Modeling Lecture 2: Behavioral Modeling with UML Lecture 3: Advanced Modeling with UML
[Note: This version of the tutorial series is based on OMG UML Specification v. 1.4, UML Revision Task Force recommended final draft, OMG doc# ad/01-02-13.]

Introduction to UML

3

Tutorial Goals 

What you will learn: 
 

 

what the UML is and what is it not UML s basic constructs, rules and diagram techniques how the UML can model large, complex systems how the UML can specify systems in an implementation-independent manner how UML, XMI and MOF can facilitate metadata integration Object Modeling 101 object methods or processes Metamodeling 101 

What you will not learn: 
 

Introduction to UML

4

Quick Tour 
    

Why do we model? What is the UML? Foundation elements Unifying concepts Language architecture Relation to other OMG technologies

Introduction to UML

5

Why do we model? 
  

Provide structure for problem solving Experiment to explore multiple solutions Furnish abstractions to manage complexity Reduce time-to-market for business problem solutions Decrease development costs Manage the risk of mistakes 



Introduction to UML

6

The Challenge

Tijuana ³shantytown´: http://www.macalester.edu/~jschatz/residential.html

Introduction to UML

7

The Vision

Fallingwater: http://www.adelaide.net.au/~jpolias/FLW/Images/FallingWater.jpeg Introduction to UML 8

Why do we model graphically? 

Graphics reveal data. 

Edward Tufte The Visual Display of Quantitative Information, 1983 

1 bitmap = 1 megaword. 

Anonymous visual modeler

Introduction to UML

9

Quick Tour 

The UML is a graphical language for 
  

specifying visualizing constructing documenting    

the artifacts of software systems Added to the list of OMG adopted technologies in November 1997 as UML 1.1 Most recent minor revision is UML 1.3, adopted in November 1999 Next minor revision will be UML 1.4, planned to be adopted in Q2 2001 Next major revision will be UML 2.0, planned to be completed in 2002
Introduction to UML 10

UML Goals 
 

 

Define an easy-to-learn but semantically rich visual modeling language Unify the Booch, OMT, and Objectory modeling languages Include ideas from other modeling languages Incorporate industry best practices Address contemporary software development issues 

scale, distribution, concurrency, executability, etc.  

Provide flexibility for applying different processes Enable model interchange and define repository interfaces
Introduction to UML 11

OMG UML Evolution
c siti ( l - rt) r l ti s i <<document>> UML 2.0

2002 (planned)

2001 Q4 (planned)

dependenc rel ti ns ip

1999

<<document>> UML 1.3

1998

Edit ri l r visi it t si ific t c ic l c

t s.

<<document>> UML 1.2

1997 (adopted by OMG)

<<document>> UML 1.1

Introduction to UML 

Q1 2001

¥   ¡

¢§£¡¥ ¡ £¥ ¢ £¡ £§ ¦ ¥ ¤ £  ¢ ¡  

© ¥ £  ¡ ¢ ¡© ¢  ¥¤ £   © ¨ 
<<document>> UML 2.0 Infrastructure <<document>> UML 1.4

<<document>> UML 2.0 Superstructure

<<document>> UML 2.0 OCL

Fr

[K br n 01 ].

12

OMG UML Contributors
Aonix Colorado State Uni ersity Computer Associates Concept Fi e Data Access EDS Enea Data Hewlett-Packard IBM I-Logix InLine Software Intellicorp Kabira Technologies Klasse Objecten Lockheed Martin Microsoft ObjecTime Oracle Ptech OAO Technology Solutions Rational Software Reich SAP Softeam Sterling Software Sun Taskon Telelogic Unisys «

Introduction to UML

13

OMG UML 1.4 Specification 
   

UML Summary UML Semantics UML Notation Guide UML Example Profiles  Software Development Processes  Business Modeling Model Interchange 


Model Interchange Using XMI Model Interchange Using CORBA IDL 

Object Constraint Language

Introduction to UML

14

Tutorial Focus: the Language 

language = syntax + semantics  

syntax = rules by which language elements (e.g., words) are assembled into expressions (e.g., phrases, clauses) semantics = rules by which syntactic expressions are assigned meanings  

UML Notation Guide defines UML s graphic syntax UML Semantics defines UML s semantics
Introduction to UML 15

Foundation Concepts
Building blocks  Well-formedness rules 

Introduction to UML

16

Building Blocks 

The basic building blocks of UML are:   

model elements (classes, interfaces, components, use cases, etc.) relationships (associations, generalization, dependencies, etc.) diagrams (class diagrams, use case diagrams, interaction diagrams, etc.) 

Simple building blocks are used to create large, complex structures 


cf. elements, bonds and molecules in chemistry cf. components, connectors and circuit boards in hardware

Introduction to UML

17

Diagram: Classifier View
Element

<<c v lent>> Carbon Hydrogen

<<c v lent>>

Introduction to UML

18

Diagram: Instance View
: dr en : dr en

:

dr

en

:

r

n

:

r

n

:

dr

en

:

dr

en

:

dr

en

Introduction to UML

19

Well-Formedness Rules  

Well-formed: indicates that a model or model fragment adheres to all semantic and syntactic rules that apply to it. UML specifies rules for: 
   

naming scoping visibility integrity execution (limited) 

However, during iterative, incremental development it is expected that models will be incomplete and inconsistent.
Introduction to UML 20

Well-Formedness Rules (cont d) 

Example of semantic rule: Class [1]  

English: If a Class is concrete, all the Operations of the Class should have a realizing Method in the full descriptor. OCL: not self.isAbstract implies self.allOperations-> forAll (op | self.allMethods-> exists (m | m.specification-> includes(op)))

Introduction to UML

21

Well-Formedness Rules (cont d) 

Example of syntactic rules: Class 

Basic Notation: A class is drawn as a solid-outline rectangle with three compartments separated by horizontal lines. Presentation Option: Either or both of the attribute and operation compartments may be suppressed.  

Example of syntactic guideline: Class 

Style Guideline: Begin class names with an uppercase letter.

Introduction to UML

22

Unifying Concepts 

classifier-instance dichotomy 

e.g., an object is an instance of a class OR a class is the classifier of an object e.g., an interface is a specification of a class OR a class is a realization of an interface 

specification-realization dichotomy  

analysis-time vs. design-time vs. runtime 


modeling phases ( process creep ) usage guidelines suggested, not enforced
Introduction to UML 23

Language Architecture
Metamodel architecture  Package structure 

Introduction to UML

24

Metamodel Architecture
<<metamodel>> OF eta- etamodel
«metaclass» Class «metaclass» Attribute

«instanceOf» «inst nceOf»

<<met model>> L et model 
       

«met cl ss» Attribute

«met cl ss» Class

«instanceOf»

T e attri te fare of t e PassengerTicket class is an instance of t e metaclass Attribute.

PassengerTicket -issuedBy : Airline -issuingAgent : TravelAgent -fare : urrency -tax : urrency +total() +issue() +surrender() +refund()

«instanceOf»

45723990550: PassengerTicket -issuedBy : Airline = AcmeAirlines -issuingAgent : TravelAgent = TerrificTravel -fare : urrency = 5 . -tax : urrency = 57.56

Introduction to UML

! 

Anal sis 


%% % %$

"   

" # #

# #

"

«metaclass» Operation

«instanceOf» <<use>>

«met cl ss» Operation

<<use>>

odel

T e operation issue of t e PassengerTicket class is an instance of t e metaclass Operation.

From [Kobryn

b].

epresents t e User Object layer of t e 4-layer metamodel arc itecture pattern.

25

UML Metamodel Layer
Behavioral Elements
Activity Graphs package

Collaborations

Use Cases

State Machines

Model Management

Common Behavior

dependency

Foundation

Core

Extension Mechanisms

Data Types

From [Kobryn 01b].

Introduction to UML

26

Relationships to Other Modeling Technologies

Metadata layer

Meta Object Facility

XMI Facility

<<document>> UML XMI DTD pecification layer Unified Modeling Language <<document>> UML CORBA IDL

Introduction to UML

)

latform tec nology profiles

0

)

(

'

&

ustomization layer

UML Profile for CORBA

UML Profile for Telecom

omain tec nology profiles

From [Kobryn 01b].

27

Structural Modeling 
    

What is structural modeling? Core concepts Diagram tour When to model structure Modeling tips Example: Interface-based design

Introduction to UML

28

What is structural modeling? 

Structural model: a view of an system that emphasizes the structure of the objects, including their classifiers, relationships, attributes and operations.

Introduction to UML

29

Structural Modeling: Core Elements
Construct Description
a description of a set of objects t at s are t e same attributes, operations, met ods, relations ips and semantics. a named set of operations t at interface c aracterize t e behavior of an element. component a modular, replaceable and significant part of a system that packages implementation and exposes a set of interfaces. a run-time physical object that node represents a computational resource.
class

Syntax

«interface»

Introduction to UML

30

Structural Modeling: Core Elements (cont d)
Constr t scri tion
a semantic condition or restriction.
{constraint}

nt x

constr int¹

¹ An extension mechanism useful for specifying structural elements.

Introduction to UML

31

Structural Modeling: Core Relationships
Construct
association

Description

Syntax

a relationship bet een t o or more classifiers that involves connections among their instances. A special form of association that aggregation specifies a hole-part relationship bet een the aggregate ( hole) and the component part. generalization a taxonomic relationship bet een a more general and a more specific element. a relationship bet een t o modeling dependency elements, in hich a change to one modeling element (the independent element) ill affect the other modeling element (the dependent element).

Introduction to UML

32

Structural Modeling: Core Relationships (cont d)
Constr ct
r liz tion

scri tion
a relationship between a specification and its implementation.

nt x

Introduction to UML

33

Structural Diagram Tour 

Show the static structure of the model 
 

the entities that exist (e.g., classes, interfaces, components, nodes) internal structure relationship to other entities temporal information static structural diagrams 
 



Do not show 

Kinds 

class diagram object diagram component diagram deployment diagram 

implementation diagrams 


Introduction to UML

34

Static Structural Diagrams
Shows a graph of classifier elements connected by static relationships.  kinds 

class diagram: classifier view  object diagram: instance view 

Introduction to UML

35

Classes
Window Window

Window

size: Area isibility: Boolean dis l y () hid ()

{abstract, author Joe, status tested} +size: Area (100,100) # isibility: Boolean true +default-size: Rectangle #maximum-size: Rectangle -xptr: XWindow* +dis l y () +hid () +cr t () -attachXWindow(xwin:Xwindow*)

Fig. 3-20, UML N t ti

G id
36

Introduction to UML

Classes: compartments with names
Reservation
operations

guarantee() cancel () change (newDate: Date)
responsibilities

bill no-shows match to available rooms
exceptions

invalid credit card

Fig. 3-23, UML N t ti

G id
37

Introduction to UML

Classes: method body
PoliceStation

alert (Alarm) 1 station *
BurglarAlarm

isTripped: Boolean = false report () { if isTripped then station.alert(self)}
Fig. 3-2 , UML N t ti G id

Introduction to UML

38

Types and Implementation Classes
type Object * elements implementationClass HashTable 1 body

type Set addElement(Object) remo eElement(Object) testElement(Object):Boolean

implementationClass HashTableSet addElement(Object) remo eElement(Object) testElement(Object):Boolean setTableSize(Integer)

Fig. 3-2 , UML N t ti

G id
39

Introduction to UML

Interfaces: Shorthand Notation

StoreHome POSterminalHome St r inal POSterminal Store <<use

Stor -storeId: Integer -POSlist: List +create() +login(UserName, Passwd) +find(StoreId) +getPOStotals(POSid) +updateStoreTotals(Id,Sales) +get(Item)

Fig. 3-29, UML N t ti

G id
40

Introduction to UML

Interfaces: Longhand Notation

StoreHome POSterminal ome POSterminal <<use>> POSterminal <<interface>> Store +getPOStotals(POSid) +updateStoreTotals(Id,Sales) +get(Item)

Store -storeId: Integer - OSlist: List +create() +login( ser ame, ass d) +find( toreId) +get OStotals( OSid) +updateStoreTotals(Id,Sales) +get(Item)

Fig. 3-29, UML N t ti

G id
41

Introduction to UML

Associations
Company  J b  Person

employer employee

Job

salary orker 

boss ..

Manag s

Person Account

{X or}
Corporation

Fig. 3- 0, UML N t ti

G id
42

Introduction to UML

Association Ends
1
Polygon

+vertex 3  C ntains {ordered}

Point

1 1 -bundle
GraphicsB ndle

color ex ure density

Fig. 3- 1, UML N tati n G id
Introduction to UML 43

Ternary Associations
Y r

season 

T  

Pl

team

goal eeper

r

r

goal for goal agai t i losses ties

Fig. 3-

, UML N tati n G id
Introduction to UML 44

Composition
Window

scrollbar [2]: Slider title: Header body: Panel

Window

1 scrollbar
Slider

1 1 title 1 body 1
anel

2

Header

Fig. 3-

, UML N tati n G id

Introduction to UML

45

Composition

(cont d)

Wi d w

scroll ar:Sli er

2

1 title:Header 1

body:Panel

Fig. 3-

, UML N tati n G id

Introduction to UML

46

Generalization
Shape Separate Target Style

Polygon

Ellipse

Spline

. ..

Shape

Shared Target Style

Polygon

Ellipse

Spline

...

Fig. 3-

, UML N tati n G id
Introduction to UML 47

Generalization
V ehicle
po er {overlapping} po er venue venue {overlapping}

WindPowered V ehicle

MotorPowered V ehicle

Land Vehicle

Water V ehicle

Truck

Sailboat

Fig. 3- 8, UML N tati n G id
Introduction to UML 48

Dependencies
Cl A Cl B « i «in tantiat » » Cl D

« i nd»

operationZ()

« all»

Cl

C

«

i

»

ClassC combines t o logical classes

Cl

D

Cl

E

Fig. 3- 0, UML N tati n G id
Introduction to UML 49

Dependencies
Controll r «acce » acce » «acce » Di gram El ments «acce » Domain Elements Graphi s Core

«acce »

Fig. 3- 1, UML N tati n G id
Introduction to UML 50

Derived Attributes and Associations
Per {age rrent ate - birt date} birt date /age

1 Company employer 1 employer  Department 1 department Wor ForD  /Wor For om { Person.employer Person.department.employer }
Fig. 3- 2, UML N tati n G ide
Introduction to UML 51

rtm

t 

Per on

Objects
tria n g le : P oly g on
c e n te r = (0 ,0 ) v e rtic e s = ( (0 ,0 ),(4 ,0 ) ,( 4 ,3 )) bo rd e rC olo r = bla c k fillC o lo r = w h ite

tria ng le

: P oly g on

tria ng le : P o ly g o n

s c h e d u le r

Fig. 3-38, UML N tati n G ide
Introduction to UML 52

Composite objects
awindow : Window horizontalBar:ScrollBar verticalBar:ScrollBar moves surface:Pane moves

title:TitleBar

Fig. 3-39, UML N tati n G ide
Introduction to UML 53

Links
offi er Jill:Person treasurer downhillSki l b: l b president member member Joe:Person

member Chris:Person offi er

Fig. 3-

, UML N tati n G ide
54

Introduction to UML

Constraints and Comments 
e rs 1 M em {s e r- f  s e t} a ir- f  m m it t e e R e p re s e ts a i c rp ra te e tity .

e m p l ye e  0 .. 1 ss e rs 

em p l ye r 0 .. 1 m pa y

{ e rs e rs

.em p l ye r = . s s .e m p l y e r}

Fig. 3-1 , UML N tati n G ide
Introduction to UML 55

Class Diagram Example
CreditCard {abstract} PMCreditCard

<<interface>> EntityBean

OrderBean {abstract} +getOrderStatus +setOrderStatus +getLineItems +setLineItems +get reditApproved +set reditApproved *

PMOrder

order

...
1 order item PMLineItem * * 1 item commodity

buyer Customer

1

Introduction to UML

1 1

*

LineItem {abstract}

Product

Adapted from Fig. 23 [EJB 2.0].

56

Implementation Diagrams
Show aspects of model implementation, including source code structure and run-time implementation structure  Kinds 

component diagram  deployment diagram 

Introduction to UML

57

Component Diagram 

Shows the organizations and dependencies among software components
Components may be   

specified by classifiers (e.g., implementation classes) implemented by artifacts (e.g., binary, executable, or script files)

Introduction to UML

58

Components
ShoppingSessionHome <<Session>> ShoppingSession ShoppingSession

<<Entit zak:Order
33

OrderHome <<focus>> :Order Order

<<auxiliar >> :OrderInfo

Order

Fig. 3-99, UML N tati n G ide
Introduction to UML 59

2

6

OrderHome

<<auxiliar >> :Order K

2

2

545454

OrderPK

OrderInfo

Component Diagram
ShoppingSessionHome <<EJBSession>> ShoppingSession ShoppingSession

<<EJBEntity>> Catalog CatalogPK <<auxiliary>> CatalogP <<focus>> Catalog Catalog CatalogInfo <<auxiliary>> CatalogInfo

CatalogHome

CatalogHome

Catalog <<file>> CatalogJAR

ShoppingCartHome ShoppingCart <<EJBEntity>> ShoppingCart

Fig. 3-9 , UML N tati n G ide
Introduction to UML 60

7

Component Diagram with Relationships
<<auxiliar >> CatalogInfo <<focus>> Catalog <<auxiliar >> CatalogPK

<<reside

<<reside

<<reside

<<ej Entit >> Catalog

<<implement

<<file>> CatalogJAR

Fig. 3-9 , UML N tati n G ide
Introduction to UML 61

Deployment Diagram  

Shows the configuration of run-time processing elements and the software components, processes and objects that live on them Deployment diagrams may be used to show which components may run on which nodes

Introduction to UML

62

Deployment Diagram
:Client
<<browser>> :OpenSourceBrowser

(1/2)

ideoStoreSer er:AppSer er
<<Container>> VideoStoreApplication

<<Session>> ShoppingSession <<Focus>> ShoppingSession

<<Entit >> Catalog <<Focus>> Catalog

<<Entit >> ShoppingCart <<Focus>> ShoppingCart

:DBSer er
<<database>> :VideoStoreDB

Fig. 3-9 , UML N tati n G ide
Introduction to UML 63

8

8

Deployment Diagram
pri ar Ser er:AppSer er <<database>> :AccountsDB :QuoteSer ice

(2/2)

pri ar Broker :BondBroker

<<become

backupSer er:AppSer er backupBroker :BondBroker

:QuoteSer ice

Fig. 3-98, UML N tati n G ide
Introduction to UML 64

BB

A @

9

9

9

9

9

9

A @

<<database>> :AccountsDB

When to model structure 

Adopt an opportunistic top-down+bottom-up approach to modeling structure  

Specify the top-level structure using architecturally significant classifiers and model management constructs (packages, models, subsystems; see Tutorial 3) Specify lower-level structure as you discover detail re classifiers and relationships 

If you understand your domain well you can frequently start with structural modeling; otherwise  

If you start with use case modeling (as with a use-case driven method) make sure that your structural model is consistent with your use cases If you start with role modeling (as with a collaboration-driven method) make sure that your structural model is consistent with your collaborations

Introduction to UML

65

Structural Modeling Tips    

Define a skeleton (or backbone ) that can be extended and refined as you learn more about your domain. Focus on using basic constructs well; add advanced constructs and/or notation only as required. Defer implementation concerns until late in the modeling process. Structural diagrams should 


emphasize a particular aspect of the structural model contain classifiers at the same level of abstraction 

Large numbers of classifiers should be organized into packages (see Lecture 3)

Introduction to UML

66

Interface-Based Design 

Interface-based design is a design approach that 


emphasizes the specification of system interfaces separates the specification of service operations (interfaces) from their realization (implementation) 

CORBA IDL is typically used for interfacebased design of CORBA applications  



defines interfaces for business and system objects without constraining their implementations defines the structure of an distributed application doesn t allow you to specify object behavior or class relationships other than generalization

Introduction to UML

67

Interface-Based Design (cont d) 

The following example shows how UML can model the interfaces for a Point of Sale application originally specified in CORBA IDL. From [Kobryn 2000].

Introduction to UML

68

Example: Interface-based design
module POS { typedef long POSId; typedef string Barcode; interface InputMedia { typedef string OperatorCmd; void void }; interface OutputMedia { boolean output_text( string_to_print ); }; «.. barcode_input(in Barcode item); keypad_input( in OperatorCmd cmd);

in string

Generic IDL Point of Sale (POS) example. [Siegel 00]
Introduction to UML 69

Example: Interface-based design
«.. interface { void void void void void quantity); void }; }; #endif /* _POS_IDL_ */ POSTerminal login(); print_POS_sales_summary(); print_store_sales_summary(); send_barcode( in Barcode item_quantity( in long end_of_sale();

item);

Introduction to UML

70

From [Kobr n

].

Point-of-Sale
+POSref : POSterminal

«IDLinterface IOutput edia Output edia

+ ut ut ext()

«IDLinterface IStore

POSter inal

+totals : Totals +POSlist : List +initializati n() +l in() +getPOSt tals() +updateSt reTotals()

Store

«IDLinterface I ax Tax +rate : float

«IDLinterface IStoreAccess

Introduction to UML

R

+initializati n() +calculateTax() +findTaxablePrice()

StoreAccess

+depotRef : Depot +taxRef : Tax +storeMarkup : float +storeId : Integer +initializati n() +find rice()

d

T

b

b b

I

S

I

cb

G

C

H

F E D

V

Q

H

+storeRef : Store +storeAccessRef : StoreAccess +outputMediaRef : OutputMedia +taxRef : Tax +POSid : Integer +itemBarcode : Integer +itemQuantity : Integer +itemInfo : ItemInfo +itemPrice : Currency +itemTaxPrice : Currency +itemExtension : Currency +saleSubtotal : Currency +taxableSubtotal : Currency +saleTotal : Currency +saleTax : Currency +POSlist : List +initializati n() +l in() +printPOSsalesSummary() +printSt reSalesSummary() +setItemQuantity() +sendBarc de() +endSale()

Input edia

+initializati n() +barc deInput() +keypadInput()

Q

«IDLinterface IPOSter inal

«IDLinterface Iinput edia

P

U

W

`

a

X

X

X

YX

71

Use Case Modeling 
    

What is use case modeling? Core concepts Diagram tour When to model use cases Modeling tips Example: Online HR System

Introduction to UML

72

What is use case modeling? 

use case model: a view of a system that emphasizes the behavior as it appears to outside users. A use case model partitions system functionality into transactions ( use cases ) that are meaningful to users ( actors ).

Introduction to UML

73

Use Case Modeling: Core Elements
Construct Description
use case A sequence of actions, including variants, that a system (or other entity) can perform, interacting with actors of the system. A coherent set of roles that users of use cases play when interacting with these use cases. epresents the boundary between the physical system and the actors who interact with the physical system.

Syntax

Use aseName

actor

ActorName

system boundary

Introduction to UML

e

74

Use Case Modeling: Core Relationships
Construct
association

Description

S ntax

The participation of an actor in a use case. i.e., instance of an actor and instances of a use case communicate with each other. generalization A taxonomic relationship between a more general use case and a more specific use case. A relationship from an extension use extend case to a base use case, specifying how the beha ior for the extension use case can be inserted into the beha ior defined for the base use case.

<<extend

Introduction to UML

75

Use Case Modeling: Core Relationships (cont d)

Construct
include

Description
An relationship from a base use case to an inclusion use case, specifying how the beha ior for the inclusion use case is inserted into the beha ior defined for the base use case.

S ntax
<<include

Introduction to UML

76

Use Case Diagram Tour   

Shows use cases, actor and their relationships Use case internals can be specified by text and/or interaction diagrams (see Lecture 2) Kinds 


use case diagram use case description

Introduction to UML

77

Use Case Diagram
T elep hon e Ca ta log C he c k s ta tus

P la ce orde r

S ales pe rso n

F ill orde rs C us tom er E sta blis h c re dit S hip pin g C le rk

S upe rviso r

Fig. 3- 3, UML Notation Guide
Introduction to UML 78

Use Case Relationships
Supp y Customer ata Order Product rran e Payment

«in lude»

«in lude»

«in lude»

Place Order
1 * xtens on po nts add onal reque :
after creation of the order

«ex end»

the salesperson asks for the catalog

equest Cata o

Fig. 3-

, UML Notation Guide
Introduction to UML 79

Actor Relationships
1 *

Place Or er

alesperson

1

*

Esta lish Cr it

Super isor
Fig. 3, UML Notation Guide
Introduction to UML 80

Use Case Description: Change Flight 
Actors:

tra eler, client account db, airline reser ation system 

Preconditions:
y

Tra eler has logged on to the system and selected µchange flight itinerary¶ option 

Basic
y

course

System retrie es tra eler¶s account and flight itinerary from client account database y System asks tra eler to select itinerary segment she wants to change; tra eler selects itinerary segment. y System asks tra eler for new departure and destination information; tra eler pro ides information. y If flights are a ailable then y « y System displays transaction summary. 
Alternati
y

e courses

If no flights are a ailable then «

Introduction to UML

81

When to model use cases 
 

Model user requirements with use cases. Model test scenarios with use cases. If you are using a use-case driven method 

start with use cases and derive your structural and behavioral models from it. 

If you are not using a use-case driven method 

make sure that your use cases are consistent with your structural and behavioral models.

Introduction to UML

82

Use Case Modeling Tips   

Make sure that each use case describes a significant chunk of system usage that is understandable by both domain experts and programmers When defining use cases in text, use nouns and verbs accurately and consistently to help derive objects and messages for interaction diagrams (see Lecture 2) Factor out common usages that are required by multiple use cases 


If the usage is required use <<include>> If the base use case is complete and the usage may be optional, consider use <<extend>> contain only use cases at the same level of abstraction include only actors who are required 

A use case diagram should 
 

Large numbers of use cases should be organized into packages (see Lecture 3)
Introduction to UML 83

Example: Online HR System
Online HR System
Locate Employees

Update Employee Profile

Manager

{if currentMonth = Oct.}
Update Benefits

Employee

Healthcare Plan System

{readOnly}

Access Travel System

Access Pay Records

Insurance Plan System

Introduction to UML

84

Online HR System: Use Case Relationships
Update edical la Update e tal la Update s a ce la

i cl de

i cl de

i cl de

Update

e efits
exten ion point na e an lo ation exte d>> employee requests stock purchase option Elect tock rc ase

E ployee

______________ poi ts Exte si benefit o tions: after required enroll ents <<exte d>> employee requests reimbursement option Elect ei b se e t for Healt care

exten ion on ition

Introduction to UML

85

Online HR System: Update Benefits Use Case 
Actors

insurance plan system 
Preconditions:
y

: employee, employee account db, healthcare plan system,

Employee has logged on to the system and selected µupdate benefits¶ option 
Basic
y y

course

System retrie es employee account from employee account db

System asks employee to select medical plan type; include Update Medical Plan.
y

System asks employee to select dental plan type; include Update Dental Plan. y « 

Alternati
y

e courses

If health plan is not a ailable in the employee¶s area the employee is informed and asked to select another plan...

Introduction to UML

86

Wrap Up 
  

Ideas to take away Preview of next tutorial References Further info

Introduction to UML

87

Ideas to Take Away 
    

UML is effective for modeling large, complex software systems It is simple to learn for most developers, but provides advanced features for expert analysts, designers and architects It can specify systems in an implementationindependent manner 10-20% of the constructs are used 80-90% of the time Structural modeling specifies a skeleton that can be refined and extended with additional structure and behavior Use case modeling specifies the functional requirements of system in an object-oriented manner

Introduction to UML

88

Preview - Next Tutorial 

Behavioral Modeling with UML 
   

Behavioral modeling overview Interactions Collaborations Statecharts Activity Graphs

Introduction to UML

89

References 
  

[UML 1.3] OMG UML Specification v. 1.3, OMG doc# ad/06-08-99 [UML 1.4] OMG UML Specification v. 1.4, UML Revision Task Force recommended final draft, OMG doc# ad/01-02-13. [Kobryn 01a] C. Kobryn, UML 2.0 Roadmap: Fast Track or Detours?, Software Development, April 2001. To appear. [Kobryn 01b] C. Kobryn, Modeling Distributed Applications with UML, chapter in [Siegel 01] Quick CORBA 3, Wiley, 2001. To be published. [Kobryn 00] Modeling CORBA Applications with UML, chapter 21 in [Siegel 00] CORBA 3 Fundamentals and Programming (2nd ed.), Wiley, 2000. [Kobryn 99] UML 2001: A Standardization Odyssey, Communications of the ACM, Oct. 1999. [EJB 2.0] Enterprise JavaBeans Specification v. 2.0, Sun Microsystems, March 31, 2000.   

Introduction to UML

90

Further Info 

Web: 
  

UML 1.4 RTF: www.celigent.com/omg/umlrtf OMG UML Tutorials: www.celigent.com/omg/umlrtf/tutorials.htm UML 2.0 Working Group: www.celigent.com/omg/adptf/wgs/uml2wg.htm OMG UML Resources: www.omg.org/uml/ uml-rtf@omg.org ckobryn@acm.org UML World 2001, New York, June 11-14, 2001 UML 2001, Toronto, Canada, Oct. 1-5, 2001 OMG UML Workshop 2001, San Francisco, Dec. 3-6, 2001 

Email 
 

Conferences & workshops 
 

Introduction to UML

91

Sign up to vote on this title
UsefulNot useful