uml in an hour
TRANSCRIPT
A Brief Introduction to UML
or
UML in an Hour
(more or less)Copyright 2000 by RWD Technologies Inc.
All Rights Reserved
04/08/23 2
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.
04/08/23 3
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.
04/08/23 4
UML Diagrams to be Covered
Class Diagrams Use Case Diagrams Collaboration Diagrams Sequence Diagrams Package Diagrams Component Diagrams Deployment Diagrams Activity Diagrams State Diagrams
04/08/23 5
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.
04/08/23 6
UML Class Diagram
DVD Movie VHS Movie Video Game
Rental Item{abstract}
Rental Invoice
1..*1
Customer
Checkout Screen
1
0..1
1
04/08/23 7
UML Class Diagram
DVD Movie VHS Movie Video Game
Rental Item{abstract}
Rental Invoice
1..*1
Customer
Checkout Screen
0..1
1
Simple
Association
Class
Abstract
Class
Simple
Aggregation
Generalization
Composition
(Dependency)
Multiplicity
04/08/23 8
IDEF1X97 Class Diagram
Rental Invoice
Customer
Checkout Screen
Class Relationship
Multiplicity/
Cardinality
DVD Movie VHS Movie Video Game
Rental Item
Dependent
class
Base class
is abstract
Generalization
(cluster)
04/08/23 9
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.
04/08/23 10
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()
04/08/23 11
Class and Object Diagrams
0..1
0..n
Customer Rental Item
Rents+name:string
+id:integer
+released:date
+id:integer
Joe: Customer Casablanca: Movie
+name:Joe Smith
+id:1667
+released:1942
+id:22340
Class Diagram
Object Diagram
Class Name
Object NameAttributes
Association Name
04/08/23 12
Stereotypes, Tagged Values and Constraints extend the UML
– Stereotypes are shown using <<>>
– Tagged Values and Constraints are shown using { }
RentalContract
<<persistent>>
{version=1.1}
ListOfRentedItems
Customer {ordered by title}
Constraint
Tagged Value
Stereotype
Stereotypes, Tagged Values and Constraints
04/08/23 13
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.
04/08/23 14
Use Case Diagram
Telephone Customer
In-StoreCustomer
Clerk
Identify Movie
Open Account
Return Movie
Customer
ReviewAccount Status
Actor
Use Case
04/08/23 15
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
Brief description Precondition Flow of events
– Main flow– Subflows– Alternate flows
Postcondition Special Requirements Enclosures
– Diagrams– Pictures of the UI
04/08/23 16
Extends and Includes Relationships
Extends
IncludesFind Item by Title
Find Items by Actor
Search MovieDatabase
«includes»
«includes»Customer
Dependency
«extends»
Stereotype
Check In Movie
AssessLate Fees
Clerk
04/08/23 17
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
04/08/23 18
:Check-out Manager
:Customer
:Inventory
1: enter_customer()
3: enter_movies()
5: add(customer, movies)
7: print invoice() 2: IsValidCust(CustId)
4:GetMovieByBarcode()
Collaboration Diagram - Rent Movie
:Clerk
Object
Message
:Rented Items
8: generateRentalTotal()
04/08/23 19
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
04/08/23 20
Sequence Diagram - Rent Movie
1: find customer()2: search (string)
4: search (string)
6: add(Cust, item)
3: enter movie()
5: rent (movie)
7: printInvoice() 8: generateRentalTotal()
Object
Lifeline
ActivationMessage
:CheckoutMgr :InventoryCust:Customer :RentedItems:Employee
04/08/23 21
Package Diagram
Clerk User Interface
«facade»BusinessSystemClient
(to businesssystem )Custom er Data
Renta l ScreenClass
Package
04/08/23 22
Component Diagram
«applica tion»V ideo
W orksta tion(vsta tion .exe)
« lib rary»D B S erverIn terface
(dbsvr.d ll)
Supplied byM icrosoft
«lib rary»A pplica tionFram ework(appfr.d ll)
Component
Interface
Dependency
Note
04/08/23 23
C heck O ut Term ina l:C lerk C lien t
P hone C lerk Term ina l:C lerk C lien t
:S tore S erver
S erverD B
S toreS erver
A pp«TC P /IP »
«TC P /IP »
Node
Communication
Association
Deployment Diagram
04/08/23 24
Identify Caller
Create Account
Obtain Name& Address
Open Account?Current
Customer? [no] [no]
[yes][yes]
Action State
Start State
Decision
End State
Activity Diagram
04/08/23 25
Identify Movie
PlaceOrder
Place Order
FillOrder
Pay
DeliverMovie
PickupMovie
Customer Manager Walking Clerk
Fork Point
Join Point
CollectMoney
Swimlanes and Fork/Join Points
04/08/23 26
State Diagram
Validate
do/checkaccount
custom er appears
Check-Out
do/check-outvideo
[account valid ]/get first video
[m ore videos]/get next video
Check-OutComplete
[no m ore videos]
[account notvalid]State
Transition
Activity
Guard
Action
Event
04/08/23 27
UML Diagram UsageDevelopmentPhase
UML Diagrams
Analysis Use Cases, Class Diagrams, ActivityDiagrams, Collaboration Diagrams,Sequence Diagrams
Design Class Diagrams, CollaborationDiagrams, Sequence Diagrams, StateDiagrams, Component DiagramsDeployment Diagrams
Development Collaboration Diagrams, SequenceDiagrams, Class Diagrams, StateDiagrams, Component Diagrams,Deployment Diagrams
Implementation Package Diagrams, DeploymentDiagrams
04/08/23 28
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.
04/08/23 29
Questions If I don’t know the answer, maybe I can
make one up!
04/08/23 30
For more information…
Contact:
John T. Bell
RWD Technologies Inc.
10480 Little Patuxent Parkway
Columbia, MD 21044
Phone: 410-884-2453
email: [email protected]
http://www.rwd.com