Upload
vivien-davis
View
217
Download
2
Embed Size (px)
Citation preview
COP 4232Software Systems Development
Introduction to UML
© Dr. David A. Workman
School of EE and CS
University of Central Florida
May 19, 2003
August 27, 2003
August 27, 2003 (c) Dr. David A. Workman 2
References
• UML Specification (V1.3)
Object Management Group (OMG), March 2000
OMG Home
• UML Reference Manual
by Rumbaugh, Jacobson, & Booch
Addison-Wesley, 1998
• UML Distilled
by Martin Fowler and Kendall Scott
Addison-Wesley, 1997
August 27, 2003 (c) Dr. David A. Workman 3
UML Introduction• Purpose
“UML is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system.” (OMG)
“The UML represents the culmination of best practices in practical object-oriented modeling.” (OMG)
• History
– “UML unifies the methods of James Rumbaugh, Grady Booch, and Ivan Jacobson.”
– Sally Shlaer & Steve Mellor (1989 – 91) OO Systems Analysis + Object Lifecycles
– Peter Coad & Ed Yourdon (1991) (OOA & OOD)
– SmallTalk (Wirfs-Brock) Class-Responsibility-Collaboration (CRC) Methodology
– Booch/Rational work on Ada (1994 – 95) OO Analysis and Design with Apps.
– Rumbaugh (GE) Object Modeling Technique (OMT) 1991 – 96
– Jim Odell & James Martin ( IS applications )(1994 – 96)
– Jacobson (Ericsson) OO Software Engineering (1994-95)
– Rumbaugh joins Rational to work with Booch (1994)
– Rational bought Objectory & Jacobson (1995)
– Through OMG & Rational, UML was born.
August 27, 2003 (c) Dr. David A. Workman 4
UML Concepts and Notation
UML
Things DiagramsRelationships
GroupingBehavioralStructural Annotational
Use caseClass
Active ClassInterface
ComponentCollaboration
Node
InteractionState Machine
PackageModel
SubsystemFramework
Note
DependencyAssociation
Generalization
Use caseClass
SequenceCollaboration
StatechartActivity
ComponentDeployment
August 27, 2003 (c) Dr. David A. Workman 5
UML Concepts and Notation
Name
Attributes(private)
Operations(public)
Respon-sibilities(public)
Class Active Class
Name
Packages
Textual content
Note
Action
Use case
Actor
AnalysisEntity Class
AnalysisBoundary Class
AnalysisControl Class
Relationships
AssociationDependency or FlowRefinementGeneralizationCompositionAggregation
ComponentName
Attributes(private)
Operations(public)
Respon-sibilities(public)
Name
class
class
class
class
1
*
0..1
m..n
exactly one
zero or more
optional
boundedrange{ constraint } « stereotype »
August 27, 2003 (c) Dr. David A. Workman 6
UML Class & Object ExamplesClass
Class with details suppressedAbstract classes have italicized names
Class
width: Lengthheight: Length ready: Bool/area: Length2
display()reset()
Class with analysis-level details
attributes: type or descriptionderived attributes denoted by “/”are computable from other attributes
methods or responsibilities(functional capabilities)
Class
+size: Area(50,100)#ready: Bool = false-winptr: Window&
+display()+reset()-attach(Window& Obj)
Class with implementation-level details
+ denotes public accessibility# denotes protected accessibility- denotes private accessibility
parameters and types specifiedaccessibility attributes specified
x :Point
size = (20, 45)ready = true
An instance ofclass “Point” named “x”
values of instance attributes
Objects
:ClassAn anonymous instance of anactive class
Class Name« boundary »
{attribute = value,…}
Class Properties
Class
« stereotype »{ class attributes }
h /head:PointInstance with/role specified.
August 27, 2003 (c) Dr. David A. Workman 7
UML Class Relationships
Fig 3-1 Class Diagram
Show: StringShowDate: DateShowTime: HoursSeat: Location
SetShow( Pid: String )SetDate( D: Date)…
Ticket
SeasonalPeriod: Date[]
Reservation
aplace: Theatre
One_Time
holds
1
0..1
6..121
0..1
*
CustomerName: StringPhone: String
Add(name, phone)
class
Instanceattributes Class
methods
association
generalization
Constraint {xor}
multiplicities
Performance
Id: StringStart: DateEnd: DateTimes: Hours[]
BuyTickets( N: Integer)Available(): IntegerGetTimes(): Hours[]GetDates(): Date[]
1
0 .. SeatCapacity
1
Make( D: Date[], T: Hours[] )
Make( D: Date, T: Hours )
1
1..*
aggregation
TheatreSeatingCapacity: Integer
Offering( Id: String): BoolAvailability(): Dates[]
August 27, 2003 (c) Dr. David A. Workman 8
MakePayment
Buy tickets
Buy subscription
Survey sales
* *
* *
* *
* *
Box Office
Kiosk
Clerk
Credit card service
Supervisor
«include»
«include»
system
relationships
actor
Use case
Use Case Diagram
August 27, 2003 (c) Dr. David A. Workman 9
x : A
y : B
Passive instance (x) in class ( A )
Active instance (y) in class ( B )
Z : Active one-of-a-kind object ( Z )
:C Arbitrary instance of passive class ( C )
Time period object is activated(passive or active)
Time period object is suspended(active objects)or inactive (passive objects)
Procedure call
Return from a call
Asynchronous call
return value
Sender Receiver
Service( parms )
Service( parms )
The object that reactsto call ( i.e., provides "Service")
Sequence Diagrams
August 27, 2003 (c) Dr. David A. Workman 10
y : B : C
x : Acreate
Xdestroy
Branchin control
Mergein control
: E : D
Recursivecall
return
alpha
beta
(1)
See ‘Notes’Page
Sequence Diagrams
August 27, 2003 (c) Dr. David A. Workman 11
UML Sequence Diagrams
See ‘Notes’Page
y : B x : A
Synchronouscall from one active object toanother
: E
alpha
beta
return
return
August 27, 2003 (c) Dr. David A. Workman 12
Kiosk Box officeCredit card service
Request(count, performance)
Show availability(seat-list)
Select(seats)
Demand payment(cost)
Insert card(card number)Charge (card number, cost)
authorized
Print tickets(performance, seats)
Eject card
Sequence Diagram: Example
August 27, 2003 (c) Dr. David A. Workman 13
Kiosk
ticketSeller
performanceGuide
db:PerformanceDB
:PerformanceDB
3: seat-list:=lock(count) 6: claim(seats) 7: unlock(seat-list)
«local» db
dbs
2: db:=findDB(performance)
1:request(count, performance)
4:offer(seat-list)
5:buy(seats)
8:confirm(seats,cost)
Active object
link
Passive object
Transient link
messages
multiobject
Collaboration Diagram
August 27, 2003 (c) Dr. David A. Workman 14
exchange
Assign to subscription
Available
Timed out
lock
unlock
Locked Soldbuy
Initial state
state
transition
Trigger event
StateChart
August 27, 2003 (c) Dr. David A. Workman 15
Pick Show
PublicizeShow
Schedule Show
Perform
HireArtists
DesignLighting
BuildSets
Sell tickets
Buy scripts and music
MakeCostumes
rehearsal
Dress rehearsal
activity
fork
Completion transition
join
Activity Diagram
[cast not learned roles]
[production cost met]
[reviews good & sales good ]Terminate
August 27, 2003 (c) Dr. David A. Workman 16
* *
* ** *
CreditCardCharges
CreditCardAgency
«database»
TicketDB
TicketSeller
KioskInterface ClerkInterface
ManageInterface
* *
Supervisor
CustomerClerk
actor
supplier
interface
client
purchase status
groupSales
subscriptionSales individualSales
Component Diagram
August 27, 2003 (c) Dr. David A. Workman 17
* *
* ** *
* *CreditCardAgency actor
Manager
component
dependency communication association
CreditCardCharges ManagerInterface
TicketSeller
«database»
TicketDB
TicketServernode
Customer Clerk
CustomerInterface ClerkInterface
Kiosk SalesTerminal
1
**
1
Deployment Diagram (Class Level)
August 27, 2003 (c) Dr. David A. Workman 18
Main St. Kiosk:Kiosk
Headquarters:TicketServer
River St. box office:SalesTerminal Telesales office:SalesTerminal
Valley Mall kiosk:Kiosk
Node instance
Communication linkNode name Node type
Deployment Diagram (Instance Level)
August 27, 2003 (c) Dr. David A. Workman 19
«Subsystem»Planning
Subsystem
package
dependency
Publicity Scheduling
Customer Ticket Sales Ticket Records
Purchasing Accounting Payroll
Records
«Subsystem»Box Office
«Subsystem»Operations
Packages and Subsystems