Introduction To UML: Todd Bacastow Penn State University Geography 583 Geospatial System Analysis & Design
Introduction To UML: Todd Bacastow Penn State University Geography 583 Geospatial System Analysis & Design
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
Rental Invoice
1
Checkout Screen
DVD Movie VHS Movie Video Game
UML Class Diagram
Multiplicity
Customer Simple
1
Class Aggregation
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()
Class Diagram
Attributes
Object Name
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
: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)
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
[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
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.