0% found this document useful (0 votes)
26 views24 pages

Introduction To UML: Todd Bacastow Penn State University Geography 583 Geospatial System Analysis & Design

Uploaded by

Huda Khalil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views24 pages

Introduction To UML: Todd Bacastow Penn State University Geography 583 Geospatial System Analysis & Design

Uploaded by

Huda Khalil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
You are on page 1/ 24

Introduction to UML

Todd Bacastow
Penn State University
Geography 583
Geospatial System Analysis & Design
What is the UML?
• Unified Modeling Language
• It is a modeling language, not a
process
• In 1996, work on the UML was
begun by Rational.
UML Diagrams
1. Class Diagrams
2. Use Case Diagrams
3. Collaboration Diagrams
4. Sequence Diagrams
5. Package Diagrams
6. Component Diagrams
7. Deployment Diagrams
8. Activity Diagrams
9. State Diagrams
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.
UML Class Diagram
Customer
1

Rental Invoice

Rental Item 1..*


1 0..1

1
Checkout Screen
DVD Movie VHS Movie Video Game
UML Class Diagram
Multiplicity

Customer Simple
1
Class Aggregation

Abstract Rental Invoice


Class

Rental Item 1..*


{abstract}
1 0..1
Composition
Simple
Generalization (Dependency)
Association

Checkout Screen
DVD Movie VHS Movie Video Game
Parts of a Class
• Classes can have four
MyClassName
parts
+SomePublicAttribute : SomeType
– Name
-SomePrivateAttribute : SomeType
– Attributes #SomeProtectedAttribute : SomeType

– Operations +ClassMethodOne()
– Responsibilities +ClassMethodTwo()

• Classes can show Responsibilities

visibility and types. -- can optionally be described here.

• All parts but the Name


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

Customer Rental Item


+id:integer Rents 0..n +id:integer
+name:string +released:date
0..1

Class Diagram
Attributes
Object Name

Joe: Customer Casablanca: Movie


+id:1667 +id:22340
+name:Joe Smith +released:1942

Object Diagram
Use Cases
• Describe interactions between users and
computer systems (both called actors) .
• Capture user-visible functions.
• Achieve discrete measurable goals.
• Are typically used during Analysis and
Design.
Use Case Diagram
Use Case
Actor

Identify Movie

Open Account
Customer Clerk

Return Movie

In-Store Telephone Review


Customer Customer Account Status
Use Case Report
• The Use Case Report •• Brief
Brief description
description
provides •• Precondition
Precondition
documentation for •• Flow
Flow of
of events
events
–– Main
Main flow
flow
the Use Case. –– Subflows
Subflows
• A Use Case is not –– Alternate
Alternate flows
flows
•• Postcondition
complete without the Postcondition
•• Special
Special Requirements
Requirements
report.
•• Enclosures
Enclosures
• The elements of the –– Diagrams
Diagrams
Use Case Report are –– Pictures
Pictures of
of the
the UI
UI
shown on the right.
Collaboration Diagrams
• Collaboration diagrams describe
interactions and links
• Focus on exchange of messages
between objects
• Appears during Analysis phase
• Enhanced during Design phase
Collaboration Diagram - Rent Movie

:Rented Items

1: enter_customer()
5: add(customer, movies) Object
8: generateRentalTotal()
3: enter_movies()
7: print invoice() 2: IsValidCust(CustId)

:Check-out :Customer
Manager
:Clerk

4:GetMovieByBarcode()

:Inventory Message
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
Sequence Diagram - Rent Movie
:CheckoutMgr Cust:Customer :Inventory :RentedItems
: Employee

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

3: enter movie() 4: search (string) Object

Message Activation
5: rent (movie)
6: add(Cust, item)

Lifeline
7: printInvoice() 8: generateRentalTotal()
Package Diagram
C lerk U ser Interface

(to business
C ustom er D ata «facade» system )
B usiness
S ystem
C lient

Class
R ental S creen Package
Component Diagram
Component
«library»
D B S erver
Interface
(dbsvr.dll)

«library»
Interface
A pplication
F ram ew ork
(appfr.dll)
Dependency

«application»
V ideo
W orkstation Note S upplied by
(vstation.exe) M icrosoft
Deployment Diagram

Node
:S tore S erver
Communication
Association
S erver
DB
P hone C lerk T erm inal
:C lerk C lient «T C P /IP »

S tore
C heck O ut T erm inal S erver
:C lerk C lient «T C P /IP » A pp
Activity Diagram
Start State

Identify Action State


Caller

Obtain Name Decision


& Address
Open
Current Account?
Customer? [no] [no]

[yes]
[yes] End State

Create
Account
Swimlanes and Fork/Join Points
Customer Manager Walking Clerk
Identify
Movie Fork Point

Place
Order

Place
Order

Fill
Collect Order
Pay
Money

Pickup Deliver
Movie Movie Join Point
State Diagram
Guard

Event

Transition [m ore videos]


/get next video
custom er appears
Validate [account valid] Check-Out Action
do/check /get first video do/check-out
account video

Activity [no m ore videos]

Check-Out
[account not Com plete
State valid]
UML Diagram Usage
Development UML Diagrams
Phase
Analysis Use Cases, Class Diagrams, Activity
Diagrams, Collaboration Diagrams,
Sequence Diagrams
Design Class Diagrams, Collaboration
Diagrams, Sequence Diagrams, State
Diagrams, Component Diagrams
Deployment Diagrams
Development Collaboration Diagrams, Sequence
Diagrams, Class Diagrams, State
Diagrams, Component Diagrams,
Deployment Diagrams
Implementation Package Diagrams, Deployment
Diagrams
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 developers.
• UML can be used as an effective data
modeling tool as well as an object
modeling tool.

You might also like