Explosion of OO methods/notations
No agreed terminology
No standards
No method that satisfy a users needs completely
Booch, OMT, and OOSE among the most popular
methods
New generations of methods/notations
Jrgen Brstler
jubo@cs.umu.se
http://www.cs.umu.se/~jubo
Current Status
UML
Class Diagrams
Static model of the problem (analysis) or the
solution (design)
Describe the types of objects and their (static)
interrelationships
Main elements:
<class name>
Classes
Attributes
Methods
Relationships
Statechart diagram
Activity diagram
Object diagram
Component diagram
Deployment diagram
Copyright jubo@cs.umu.se
strength
Unification efforts
Rational
OPEN consortium
Booch, Rubaugh
Firesmith, Graham,
(10/94), Jacobson (fall
Henderson-Sellers,
95), UML consortium
Yourdon,
(during 96)
Toolbox approach
Unified (v0.8, 10/95)
Tailorable
UML (v0.9, 06/96)
Integration with
Copyright jubo@cs.umu.se
OMG Standardization
UML?
UML
UML
Dependency
Association
Aggregation/Composition
Generalisation
Realisation
Copyright jubo@cs.umu.se
<attribute list>
<method list>
Class Notations
Analysis
Dependency
Window
Window
{author = Joe,
status = tested }
Window
size: Area
maxSize
create()
resize()
repaint()
UML
Design
VideoClip
name
play( on: Channel)
start()
stop()
rewind()
+create()
+resize( in f: real = 1,25): Area
#repaint( in gc: Graphics)
Copyright jubo@cs.umu.se
UML
Association 1
*
employer
Copyright jubo@cs.umu.se
Association 2
Associations may have attributes and behaviour
(association classes)
Association classes are quite similar to the
relationship types known from ER modelling
Association names may have reading directions
Channel
1..*
Works-for
Company
1..*
Works-for
employer
Job
boss
salary
Person
employee
Person
employee
worker
0..1
*
Manages
UML
Copyright jubo@cs.umu.se
UML
Copyright jubo@cs.umu.se
Generalisation
Polygon
Aggregation
Composition
Student
Employee
1
3..*
Point
UML
Graphics
color
Texture
Mentor
Copyright jubo@cs.umu.se
UML
Copyright jubo@cs.umu.se
{> 0}
Corporation
BankAccount
balance
{or}
compare ()
Responsibilities:
-- keep current balance
-- handle deposits and
withdrawals
PersNr
Person
gender: {female, male}
Sortable
UML
wife
0..1
husband 0..1
Notes, like this one
can be attached to any
notational element
A constraint written
in OCL (Object Constraint
Language)
Copyright jubo@cs.umu.se
10
Notes, Constraints,
Qualifiers, and Interfaces
CID
Manager
11
UML
12
Sequence Diagrams 1
Sequence Diagrams 2
add a
course
Course Maintenance
Form
:Registrar
tdbc18: Course
1: enter id
time
3: create course
6: create
An activation
bar
7: save
Copyright jubo@cs.umu.se
13
UML
Some Guidelines
for Sequence Diagrams
UML
Copyright jubo@cs.umu.se
14
8: close form
UML
The lifeline
of the object
2: verify id
5: submit
:League_Official
theJudge
???
assign( theJudge)
is_assigned
is_qualified( theEvent)
is_qualified( theEvent, theJudge)
addJudge( theJudge)
success
15
UML
Copyright jubo@cs.umu.se
Shouldnt there
be a third party to
decide on that?
16
Alternative 2..n:
League
Equipment
...
Competition
1
Judging Panel
5
Judge
1..n
is_assigned( ): boolean
UML
Event
{abstract}
assign( Judge)
is_qualified( Judge)
BalanceBeam
Floor
Vault
Copyright jubo@cs.umu.se
17
UML
Statechart Diagrams 1
Graphical notation for class behaviour modelling
Describe all possible states and state changes
triggered by external stimuli
Good tool to describe complex object life cycles
Good tool to uncover missing state information
and behaviour
An internal
transition
A deferred
event
UML
<state name>
<attribute list>
entry / <action>
exit / <action>
do / <action>
<event> / <action>
<event> / defer
event trigger
[ guard condition] / action
if event then
if condition then
trigger transition;
execute action
else
nothing happens;
Copyright jubo@cs.umu.se
18
Statechart Diagrams 2
States can be nested
Substates may be concurrent
Transitions may have multiple sources and/or
destinations
start
Copyright jubo@cs.umu.se
<state name>
stop
19
UML
Copyright jubo@cs.umu.se
20
Some Guidelines
for Statechart Diagrams
Activity Diagrams 1
Copyright jubo@cs.umu.se
21
Activity Diagrams 2
Customer
Sales
Warehouse
Request product
Process order
[not available]
[in stock]
Pull materials
Ship order
Receive order
Bill customer
Object flow
Pay bill
b: Bill
[paid]
UML
b: Bill
[unpaid]
Close order
Copyright jubo@cs.umu.se
23
UML
Copyright jubo@cs.umu.se
22