Vous êtes sur la page 1sur 30

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.

03/31/15

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.

03/31/15

UML Diagrams to be Covered


Class Diagrams
Use Case Diagrams
Collaboration Diagrams
Sequence Diagrams
Package Diagrams
Component Diagrams
Deployment Diagrams
Activity Diagrams
State Diagrams

03/31/15

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.

03/31/15

UML Class Diagram


Customer

Rental Invoice

Rental Item
{abstract}

1..*

0..1

1
DVD Movie

03/31/15

VHS Movie

Video Game

Checkout Screen

UML Class Diagram


Customer
Class

Multiplicity
Simple

Aggregation

Rental Invoice

Abstract
Class
Rental Item
{abstract}

1..*

0..1

Composition

DVD Movie

03/31/15

Simple

(Dependency)

Generalization

VHS Movie

Video Game

Association
Checkout Screen

IDEF1X97 Class Diagram


Class

Customer

Relationship

Rental Invoice

Dependent
class
Rental Item

Generalization
(cluster)
Multiplicity/
Base class

Cardinality

is abstract
DVD Movie

Checkout Screen
VHS Movie

03/31/15

Video Game

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.

03/31/15

MyClassName
+SomePublicAttribute : SomeType
-SomePrivateAttribute : SomeType
#SomeProtectedAttribute : SomeType
+ClassMethodOne()
+ClassMethodTwo()
Responsibilities
-- can optionally be described here.

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.

03/31/15

ThisOne : MyClassName
+SomePublicAttribute : SomeType
-SomePrivateAttribute : SomeType
#SomeProtectedAttribute : SomeType
+ClassMethodOne()
+ClassMethodTwo()

10

Class and Object Diagrams


Association Name

Class Name

Customer
+id:integer
+name:string

Rental Item
Rents
0..1

0..n +id:integer
+released:date

Class Diagram
Attributes
Object Name

Joe: Customer

Casablanca: Movie

+id:1667
+name:Joe Smith

+id:22340
+released:1942

Object Diagram

03/31/15

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

03/31/15

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.

03/31/15

13

Use Case Diagram


Use Case
Actor

Identify Movie

Customer

Open Account

Clerk

Return Movie

In-Store
Customer

03/31/15

Telephone
Customer

Review
Account Status

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.

03/31/15

Brief
Brief description
description
Precondition
Precondition
Flow
Flow of
of events
events
Main
Main flow
flow
Subflows
Subflows
Alternate
Alternate flows
flows
Postcondition
Postcondition
Special
Special Requirements
Requirements
Enclosures
Enclosures
Diagrams
Diagrams
Pictures
Pictures of
of the
the UI
UI

15

Extends and Includes Relationships


Dependency
includes
Find Item
by Title

Includes

includes

Customer

Search Movie
Database

Find Items
by Actor
Stereotype

Extends

extends
Clerk

03/31/15

Check In
Movie

Assess
Late Fees

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

03/31/15

17

Collaboration Diagram - Rent Movie


:Rented Items

1: enter_customer()
3: enter_movies()

Object

5: add(customer, movies)
8: generateRentalTotal()
2: IsValidCust(CustId)

7: print invoice()
:Check-out
Manager

:Customer

:Clerk

4:GetMovieByBarcode()

:Inventory

03/31/15

Message

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

03/31/15

19

Sequence Diagram - Rent Movie


:CheckoutMgr

Cust:Customer

:Inventory

:RentedItems

Employee

1: find customer()

3: enter movie()

2: search (string)

4: search (string)

Object

Activation

Message
5: rent (movie)

6: add(Cust, item)

Lifeline
7: printInvoice()

03/31/15

8: generateRentalTotal()

20

Package Diagram
C le r k U s e r In t e r fa c e
C u s to m e r D a ta

Class

03/31/15

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

R e n ta l S c re e n

( to b u s in e s s
s y s te m )

Package

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)
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)

Interface

Dependency

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

03/31/15

Note

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

22

Deployment Diagram
Node
Communication

:S to re S e rv e r

Association

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

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

03/31/15

S e rv e r
D B
T C P /IP

T C P /IP

S to re
S e rv e r
App

23

Activity Diagram
Start State

Identify
Caller

Action State

Obtain Name
& Address
Current
Customer?

Decision
Open
Account?

[no]

[no]
[yes]

[yes]

End State

Create
Account

03/31/15

24

Swimlanes and Fork/Join Points


Customer
Identify
Movie

Manager

Walking Clerk

Fork Point

Place
Order
Place
Order

Pay

Collect
Money

Pickup
Movie

Deliver
Movie

03/31/15

Fill
Order

Join Point

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 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

Activity

State

03/31/15

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

C h e c k -O u t

Action

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

26

UML Diagram Usage


Development
Phase

UML Diagrams

Analysis

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

Design

Development

Implementation

03/31/15

27

Conclusion
UML is a robust notation that can express

information gathered throughout a projects


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.

03/31/15

28

Questions

03/31/15

If I dont know the


answer, maybe I can
make one up!

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
03/31/15

30

Vous aimerez peut-être aussi