Professional Documents
Culture Documents
Idea of modeling
Short overview on OO
Class Diagrams
Sequence Diagrams
UML:
First Pass
Class diagrams
Functional
model
Describe the functional behavior of the system as seen by the user
Describe the dynamic behavior between actors and the system and
between objects of the system
Statechart diagrams
Sequence diagrams
Object
model
Dynamic
model
Activity Diagrams
lk
C++
UML
Jav
concepts without a
counterpart
Armin B. Cremers, Sascha Alda
directly mappable
part
Organizational Requirements Engineering
language specific
details
5
UML
myWatch:SimpleWatch
Joe:Firefighter
SimpleWatch
Firefighter
UML:
Use Cases
UML:
Use Cases
Passenger
<<initiates>>
<<communicates>>
PurchaseTicket
User
External system (DB, software, devices)
Examples:
Passenger
UML:
Use Cases
UML:
Use Cases
PurchaseTicket
10
Use Cases
Textual Representation
Template for a textual use case
Use case name
Participating Actors
Flow of Events
Entry Condition
Exit Condition
Quality Requirements
Armin B. Cremers, Sascha Alda
11
Use Cases
Textual Representation
<<initiates>>
Passenger
PurchaseTicket
Purchase ticket
Participating Actors
Initiated by Passenger
Flow of Events
Initialized by an actor
Entry Condition
Exit Condition
Quality Requirements
12
UML:
Use Cases
Passenger
Purchase
Ticket
PurchaseTicket
SpecialFee
13
Passenger
z
PurchaseTicket
<<extend>>
<<extend>>
UML:
Use Cases
OutOfOrder
Supplier Use Case
Cancel
Armin B. Cremers, Sascha Alda
14
UML:
Use Cases
<<include>> relationship is
Passenger
z
PurchaseMultiCard
PurchaseSingleTicket
<<include>>
<<include>>
CollectMoney
15
Example
Example
Elements
Actor
customer
System
Use cases
Annotations
Role of
an actor
Relationships
name
salesperson
place order
comments ...
B
<<include>>
<<extend>>
B
B
<<inherit>>
16
<<include>> relationship
Flow of Events
CollectMoney
3.
PurchaseTicket
Supplier
Use Case
<<extend>> relationship
<<extend>>
Cancel
Base
Use Case
CollectMoney
The Cancel use case extends any use case in which the the
user presses the Cancel button
1.
Base
Use Case
...
4.
Flow of Events
<<include>>
17
User Participation
Goals
Classification in SE Process
Problem
18
UML:
Use Cases
19
Classes
Verbs Functions
Nouns
Analysis:
Example:
1.
2.
3.
4.
5.
Class Passenger
Method Passenger.chooseZone()
Method
DistributionMachine.displayAmount()
20
UML: Class
Diagrams
TariffSchedule
Enumeration getZones()
Price getPrice(Zone)
Trip
zone:Zone
Price: Price
Used
21
UML: Class
Diagrams
TariffSchedule
Table zone2price
Enumeration getZones()
Price getPrice(Zone)
Name
TariffSchedule
zone2price
getZones()
getPrice()
z
z
z
z
z
Attributes
Operations
Signature
TariffSchedule
22
UML: Class
Diagrams
tarif_1974:TariffSchedule
zone2price = {
{1, .20},
{2, .40},
{3, .60}}
z
z
23
UML: Class
Diagrams
Actor:
Class:
Object:
24
UML: Class
Diagrams
Class A
aLabel
z
z
Class B
25
Class Diagrams:
UML: Class
Diagrams
has-capital
City
name:String
One-to-one association
Polygon
Point
x: Integer
draw()
* = 0,1,2,,n
y: Integer
One-to-many association
Armin B. Cremers, Sascha Alda
26
Class Diagrams:
UML: Class
Diagrams
Many-to-Many Associations
StockExchange
Lists
Company
tickerSymbol
Many-to-many association
27
Class Diagrams:
UML: Class
Diagrams
Class Diagram:
StockExchange
Company
Lists
tickerSymbol
28
Class Diagrams:
Problem Statement Object Model
UML: Class
Diagrams
Class Diagram:
StockExchange
Company
Lists
tickerSymbol
z
29
UML: Class
Diagrams
CancelButton
ZoneButton
30
Class Diagrams:
UML: Class
Diagrams
Inheritance of Interface
<<interface>>
Moveable
Implementation
Generalization
<<interface>>
Car
ExtdMoveable
Abstract classes
31
UML: Class
Diagrams
Car
usually
0..1
1
Ambulance
FireFighter
brand
power
4
Wheals
inch
1
Engine
power
32
UML: Class
Diagrams
z
z
z
Tree
Human
usually
1
*
Country
inch
or
*
Leaf
inch
Heart
inch
*
Town
power
Armin B. Cremers, Sascha Alda
33
Implies exclusivity
34
Class Diagrams:
The four is-part-of categories
exclusive
not exclusive
dependent
1..*
(propagation of
deletion operations)
+ explicit specification of
deletion propagation
company
department
0..1
independent
1.*
project
Timeplan
(no propagation of
deletion operations)
car
Armin B. Cremers, Sascha Alda
0..1
tire
project
employees
35
UML: Class
Diagrams
Person
AllocatedBy 1
Room
Room
Time
36
Modeling in
Practice
Account
Bank
Name
Value
AccountID
CustomID
Deposit()
Withdraw()
GetBalance()
Customer
Name
CustomID
37
Account
Bank
Name
Value
AccountID
Modeling in
Practice
has
Deposit()
Withdraw()
GetBalance()
Customer
Name
CustomID
38
Bank
Name
Account
Value
AccountID
Modeling in
Practice
has
Name
CustomID
Deposit()
Withdraw()
GetBalance()
CustomerID()
Savings
Account
Mortgage
Account
Checking
Account
Withdraw()
Withdraw()
Withdraw()
Customer
39
UML:
Packages
Packages
z
Packages are the basic grouping construct with which you may
organize UML models to increase their readability
DispatcherInterface
Notification
IncidentManagement
40
Dynamic
Models
Sequence diagrams
z
Passenger
TicketMachine
selectZone()
z
insertCoins()
pickupChange()
pickUpTicket()
41
Sequence diagrams:
Nested messages
Passenger
Dynamic
Models
Zone Button
selectZone()
TariffSchedule
Display
lookupPrice(selection)
price
Dataflow
displayPrice(price)
to be continued...
z
z
z
42
Sequence diagrams:
Iteration & Condition
Dynamic
Models
ChangeProcessor
*insertChange(coin)
Iteration
Condition
CoinIdentifier
Display
CoinDrop
lookupCoin(coin)
price
displayPrice(owedAmount)
[owedAmount<0] returnChange(-owedAmount)
to be continued...
z
z
z
43
Sequence diagrams:
Creation and destruction
Passenger
ChangeProcessor
Dynamic
Models
Creation
createTicket(selection)
Ticket
print()
free()
z
z
Destruction
44
Sequence diagrams:
Self-Delegation
aMethod
aMethod
z
z
45
Sequence diagrams:
Synchronous interaction
Sender
Receiver
Message
Dynamic
Models
Sender
Receiver
Message
(implied Return)
Return
Explicit return
z
Implicit return
Represent a nested control flow via an operation call. The operation call
invokes an operations synchronously (filled arrowhead)
The sender passes control to the receiver via the message and pauses
to wait for the receiver to return control (implicitly or explicitly)
Nested sequences complete before their outer sequence resume
Armin B. Cremers, Sascha Alda
46
Sequence diagrams:
Dynamic
Models
Receiver
Message
Return x
z
z
47
Sequence diagrams:
Summary
Dynamic
Models
48
It all depends.
Forward Engineering
Reverse Engineering
Roundtrip Engineering
49
50