A Brief Introduction to UML

or UML in an Hour (more or less)
Copyright 2000 by RWD Technologies Inc. All Rights Reserved

What is the UML?
Unified Modeling Language It is a modeling language, not a process Rumbaugh joined Booch at Rational in 1994; in 1995, Rational added Jacobsen to their team. In 1996, work on the UML was begun. In January of 1997, Rational released UML 1.0 to the OMG as their proposal for a methods standard.

02/12/09

2

Objectives
Upon successful completion of this presentation, you will be able to: – Visually identify UML diagrams. – Understand the differences between the UML diagrams. – Identify key symbols found in each diagram. – Identify the diagrams used in each ProVision phase.

02/12/09

3

UML Diagrams to be Covered
Class Diagrams Use Case Diagrams Collaboration Diagrams Sequence Diagrams Package Diagrams Component Diagrams Deployment Diagrams Activity Diagrams State Diagrams

02/12/09

4

Class Diagrams
Are the most fundamental UML Diagram. Describe the classes in the system, and the static relationships between classes. Class diagrams are used during Analysis, Design and Development.

02/12/09

5

UML Class Diagram
Customer

1

Rental Invoice

Rental Item {abstract}

1..*

1

0..1

1
DVD Movie VHS Movie Video Game Checkout Screen

02/12/09

6

UML Class Diagram
Customer Class

Multiplicity Simple Aggregation

1

Abstract Class Rental Item {abstract}

Rental Invoice

1..*
Composition

1
(Dependency)

0..1
Simple Association

Generalization

DVD Movie

VHS Movie

Video Game

Checkout Screen

02/12/09

7

IDEF1X97 Class Diagram
Class
Customer

Relationship

Dependent class
Rental Item

Rental Invoice

Generalization (cluster) Multiplicity/ Base class is abstract
DVD Movie VHS Movie Video Game

Cardinality
Checkout Screen

02/12/09

8

Parts of a Class
Classes can have four parts – Name – Attributes – Operations – Responsibilities Classes can show visibility and types. All parts but the Name are optional.
MyClassName +SomePublicAttribute : SomeType -SomePrivateAttribute : SomeType #SomeProtectedAttribute : SomeType +ClassMethodOne() +ClassMethodTwo() Responsibilities -- can optionally be described here.

02/12/09

9

Object Diagrams
An Object is an instance of a class. Object names are underlined. Object diagrams are similar to class diagrams. Many of the same notations are used. Object diagrams capture instances of classes, and allow the dynamic relationships to be shown.
ThisOne : MyClassName +SomePublicAttribute : SomeType -SomePrivateAttribute : SomeType #SomeProtectedAttribute : SomeType +ClassMethodOne() +ClassMethodTwo()

02/12/09

10

Class and Object Diagrams
Class Name Association Name

Customer
+id:integer +name:string

Rental Item Rents
0..1 0..n +id:integer +released:date

Class Diagram
Object Name

Attributes

Joe: Customer
+id:1667 +name:Joe Smith

Casablanca: Movie
+id:22340 +released:1942

Object Diagram
02/12/09 11

Stereotypes, Tagged Values and Constraints
Stereotypes, Tagged Values and Constraints extend the UML – Stereotypes are shown using <<>> – Tagged Values and Constraints are shown using { }
Tagged Value Stereotype

RentalContract <<persistent>> {version=1.1} ListOfRentedItems Customer {ordered by title}

Constraint

02/12/09

12

Use Cases
Describe interactions between users and computer systems (both called actors) . Capture user-visible functions. Achieve discrete measurable goals. May be – small (“Make selected text bold”) – large (“Generate a table of contents”) Are typically used during Analysis and Design.

02/12/09

13

Use Case Diagram
Use Case Actor

Identify Movie

Customer

Open Account

Clerk

Return Movie

In-Store Customer

Telephone Customer

Review Account Status

02/12/09

14

Use Case Report
The Use Case Report provides documentation for the Use Case. A Use Case is not complete without the report. The elements of the Use Case Report are shown on the right.
Brief description Precondition Flow of events – Main flow – Subflows – Alternate flows Postcondition Special Requirements Enclosures – Diagrams – Pictures of the UI

02/12/09

15

Extends and Includes Relationships
Dependency «includes»

Includes
Customer

Find Item by Title «includes» Find Items by Actor Stereotype Search Movie Database

Extends
Clerk Check In Movie

«extends» Assess Late Fees

02/12/09

16

Collaboration Diagrams
Collaboration diagrams describe object interactions organized around the objects and their links to each other Focus on exchange of messages between objects through their associations. Appears during Analysis phase Enhanced during Design phase

02/12/09

17

Collaboration Diagram - Rent Movie
:Rented Items 5: add(customer, movies) 8: generateRentalTotal() 2: IsValidCust(CustId) :Check-out Manager
:Clerk

1: enter_customer() 3: enter_movies() 7: print invoice()

Object

:Customer

4:GetMovieByBarcode()

:Inventory

Message

02/12/09

18

Sequence Diagrams
Can be “morphed” from Collaboration Diagrams. Describe interactions between objects arranged in time sequence Focus on objects and classes involved in the scenario and the sequence of messages exchanged Associated with use cases Used heavily during Analysis phase and are enhanced and refined during Design phase

02/12/09

19

Sequence Diagram - Rent Movie
:CheckoutMgr
:

Cust:Customer

:Inventory

:RentedItems

Employee 1: find customer() 2: search (string)

3: enter movie()

4: search (string)

Object

Message
5: rent (movie)

Activation
6: add(Cust, item)

Lifeline
7: printInvoice() 8: generateRentalTotal()

02/12/09

20

Package Diagram
C le r k U s e r In te r fa c e C u s to m e r D a ta
( to b u s in e s s s y s te m )

« fa c a d e » B u s in e s s S y s te m C lie n t

Class

R e n ta l S c re e n

Package

02/12/09

21

Component Diagram
Component

« lib r a r y » D B S e rv e r In te rfa c e ( d b s v r . d ll)
Interface

Dependency

« lib r a r y » A p p lic a t io n F ra m e w o rk ( a p p f r . d ll)

« a p p lic a t io n » V id e o W o r k s ta tio n ( v s t a t io n . e x e )

Note

S u p p lie d b y M ic r o s o f t

02/12/09

22

Deployment Diagram
Node Communication Association

:S to re S e rv e r

P h o n e C le r k T e r m in a l : C le r k C lie n t

S e rv e r DB « T C P /IP » S to re S e rv e r App

C h e c k O u t T e r m in a l : C le r k C lie n t

« T C P /IP »

02/12/09

23

Activity Diagram
Start State

Identify Caller

Action State

Obtain Name & Address
Current Customer?
[no]

Decision Open Account? [no] [yes]

[yes]

End State

Create Account
02/12/09 24

Swimlanes and Fork/Join Points
Customer
Identify Movie Place Order Place Order Fill Order

Manager
Fork Point

Walking Clerk

Pay

Collect Money

Pickup Movie

Deliver Movie

Join Point

02/12/09

25

State Diagram
Guard Event Transition

[m o r e v id e o s ] /g e t n e x t v id e o C h e c k -O u t d o /c h e c k -o u t v id e o [n o m o r e v id e o s ] C h e c k -O u t C o m p le te

c u s to m e r a p p e a rs V a lid a te d o /c h e c k account [ a c c o u n t v a lid ] / g e t f ir s t v id e o
Action

Activity

State

[a c c o u n t n o t v a lid ]

02/12/09

26

UML Diagram Usage
Development Phase
Analysis Design

UML Diagrams
Use Cases, Class Diagrams, Activity Diagrams, Collaboration Diagrams, Sequence Diagrams Class Diagrams, Collaboration Diagrams, Sequence Diagrams, State Diagrams, Component Diagrams Deployment Diagrams Collaboration Diagrams, Sequence Diagrams, Class Diagrams, State Diagrams, Component Diagrams, Deployment Diagrams Package Diagrams, Deployment Diagrams
27

Development

Implementation

02/12/09

Conclusion
UML is a robust notation that can express information gathered throughout a project’s lifecycle. Adopting standard use of UML can improve communication between clients and Information Systems Service Providers. UML can be used as an effective data modeling tool as well as an object modeling tool.

02/12/09

28

Questions

If I don’t know the answer, maybe I can make one up!

02/12/09

29

For more information…
Contact: John T. Bell RWD Technologies Inc. 10480 Little Patuxent Parkway Columbia, MD 21044 Phone: 410-884-2453 email: jbell@rwd.com http://www.rwd.com
02/12/09 30

Sign up to vote on this title
UsefulNot useful