Oose 2
Oose 2
Oose 2
Overview of UML
Building Blocks of the UML
Things in the UML
Relationships in the UML
Diagrams in the UML
Learning Outcomes
• Structural things are the nouns of the UML models. These are
mostly static parts of the model, representing conceptual or
physical elements.
• Structural things are called classifiers.
• Structural thing include classes, interfaces, collaborations, use
cases, components, and nodes.
• A class
– is a description of a set of objects that share the same
attributes, operations, relationships, and semantics.
– A class implements one or more interfaces. Graphically, a
class is rendered as a rectangle, usually including its name,
attributes, and operations
Actor
ReadTime
SetTime
WatchUser WatchRepairPerson
ChangeBattery
Association
Class
Multiplicity Watch
1 1 1 1
2 1 2 1
PushButton LCDDisplay Battery Time
state blinkIdx load now
push() blinkSeconds()
release() blinkMinutes()
blinkHours()
stopBlinking()
referesh()
Attribute
Operations
pressButton1() blinkHours()
pressButton1() blinkMinutes()
Activation
Lifeline
Implementation diagrams
– Component diagrams
– Deployment diagrams
Exit condition:
• Passenger has ticket.
Anything missing ?
Exceptional cases!
Compiled By: Modeling with UML 55
The <<extends>> Relationship
• <<extends>> relationships represent
exceptional or seldom invoked cases.
• The exceptional event flows are factored
Passenger
out of the main event flow for clarity.
• Use cases representing exceptional
flows can extend more than one use
case.
PurchaseTicket
• The direction of a <<extends>>
<<extends>>
relationship is to the extended use case
<<extends>>
<<extends>>
Cancel NoChange
Compiled By: Modeling with UML 56
The <<includes>> Relationship
• <<includes>> relationship
represents behavior that is
Passenger factored out of the use case.
• <<includes>> behavior is factored
out for reuse, not because it is an
PurchaseMultiCard exception.
PurchaseSingleTicket • The direction of a <<includes>>
<<includes>> relationship is to the using use
<<includes>> case (unlike <<extends>>
relationships).
CollectMoney
<<extends>> <<extends>>
NoChange Cancel
Compiled By: Modeling with UML 57
Class Diagrams
TarifSchedule
Trip
Enumeration getZones() zone:Zone
* *
Price getPrice(Zone) Price: Price