uml1
uml1
Overview
* What is UML?
First pass quickly
Package
SimpleWatch
Actor
ReadTime
SetTime
WatchUser WatchRepairPerson
Use case
ChangeBattery
Class
Operations
pressButton1() blinkHours()
pressButton1() blinkMinutes()
pressButton2() incrementMinutes()
refresh()
pressButtons1And2()
commitNewTime()
stopBlinking()
Message
Activation
Transition button1Pressed
button1&2Pressed button2Pressed
Blink Increment
Minutes Minutes
button1Pressed
button2Pressed
Stop Blink Increment
Blinking Seconds Seconds
Final state
button1&2Pressed
Other UML Notations
* Implementation diagrams
Component diagrams
Deployment diagrams
Introduced in lecture on System Design
TariffSchedule Trip
zone:Zone
Enumeration getZones() price:Price
Price getPrice(Zone)
* *
TariffSchedule
zone2price Attributes Signature
getZones()
getPrice()
Operations TariffSchedule
tariff_1974:TarifSchedule
zone2price = {
{‘1’, .20},
{‘2’, .40},
{‘3’, .60}}
TarifSchedule TripLeg
price
Enumeration getZones() * * zone
Price getPrice(Zone)
Has-capital
Country City
1 1
name:String name:String
1-to-1 association
Polygon 1 * Point
x:Integer
y:Integer
draw()
1-to-many association
Aggregation
Exhaust System
1 0..2
Muffler Tailpipe
Composition
TicketMachine
3
ZoneButton
Generalization
Button
CancelButton ZoneButton
Class Diagram
lists
StockExchange * * Company
tickerSymbol
Java Code
public class StockExchange {
public Vector m_Company = new Vector();
};
public class Company {
public int m_tickerSymbol;
public Vector m_StockExchange = new Vector();
};
Summary
Next time:
Dynamic model: sequence diagrams, statechart and
activity diagrams