The What, Why and How of the UML Collaboration Trygve Reenskaug

advertisement
The What, Why and How
of the UML Collaboration
Tutorial J3, TOOLS 2000
8 June 2000
Trygve Reenskaug@ifi.uio.no
Mogul Norge AS, Oslo
http://www.ifi.uio.no/~trygver
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:07 AM.
Slide 1
Legal Notice
This presentation is copyright
©2000 Trygve Reenskaug
Oslo, Norway.
All rights reserved.
Permission to make digital or hard copies of part or all of
this work for personal or classroom use is granted without
fee provided that the copies are not made for profit or
commercial advantage and that copies bear this notice and
full citation on the first page.
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:08 AM.
Slide 2
Activity network planning
Our main example
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:08 AM.
Slide 3
The Idea: Records --> Objects
Some relevant shipyard objects
Object representing
the Shipyard
Object representing
a ship’s schedule
Object representing
the shipyard resources
Object representing
a construction activity
Object representing
a resource
Object representing
a ship's part
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:08 AM.
Slide 4
What we need to achieve
Lay a course to intercept the future
Where we
want to go
We are here
The What, Why and How of the UML Collaboration
Two key issues:
? Vision
? Technology
© Trygve Reenskaug 2000
5/29/2016 3:32:09 AM.
Slide 5
Lay a course to intercept the future
Where we want to go
Vast Complexity
Transparent & Comprehensible
Participatory & Graduated knowledge
Support Human Communication
Multiple Owners
Interoperability
Geographic Distribution
Heterogeneous Platforms
·····
·····
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:09 AM.
Slide 6
Lay a course to intercept the future
Existing technology
» Objects
!
!
!
!
!
Vast Complexity
Transparent & Comprehensible
Participatory & Graduated knowledge
Support Human Communication
Multiple Owners
» CORBA
! Interoperability
! Geographic Distribution
! Heterogeneous Platforms
» Master complexity
! Acceptable quality
» ·····
» ·····
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:09 AM.
Slide 7
The OMG vision:
A Universe of objects
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:10 AM.
Slide 8
CORBA
Controls the Interfaces
IDL : messages
XML: information
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:10 AM.
Slide 9
A system is
a chosen perspective on reality
A system is a part of the real world which
we choose to regard as a whole,
separated from the rest of the world during
some period of consideration.
A whole that we choose to consider as a
collection of parts,
each part being characterized by attributes
and by actions which may involve itself
and other parts.
Holbæk_Hanssen et.al.: System Description and the Delta Language
Oslo, 1977
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:11 AM.
Slide 10
Consider the Universe as a
Universe of objects
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:15 AM.
Slide 11
An Open System
For a given system,
the environment is the set of all objects
outside the system
who affect the system
or who are affected by the system.
Etzioni: Modern Organizations
Prentice-Hall, 1964
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:15 AM.
Slide 12
Open systems
interact with environment objects
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:16 AM.
Slide 13
Tutorial Plan
• Introduction
• The UML collaboration
•
•
•
•
•
Typing AssociationEndRoles specifies classes.
Specialization of a collaboration
System behavior, messages and interfaces
Information hiding & component technology
Summary and conclusion
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:16 AM.
Slide 14
The UML instance level collaboration
models a system of objects
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:17 AM.
Slide 15
The UML Collaboration is a
powerful tool
•
•
•
•
•
for Modeling system behavior.
for Enterprise modeling
for Distributed system design
for System architecture at all levels
for Designing the details of an OO
program.
• for Tracing requirements between
different levels of abstractions
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:19 AM.
Slide 16
A conceptual model
implies choice of mode of thinking
• A model is never complete
• A model focuses on essentials
• A model hides inessentials
• A model reflects a CHOICE
Choice of language critical
• A productive way of thinking
is supported by a good choice
of modeling language
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:19 AM.
Slide 17
UML
Two powerful abstractions
Collaboration
abstraction
Models
system
behavior
UML
Object
Oriented
Modeling
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
Class
abstraction
Models
system
construction
5/29/2016 3:32:19 AM.
Slide 18
The UML class abstraction
The UML collaboration abstraction
• Objects are encapsulations of data and behavior.
Objects are encapsulations of data and behavior.
• Objects are instances of classes.
An object has a unique identity.
• Associations between two or more classes specify
links between their instances.
An object collaborates with other objects by message
interaction.
• An operation describes a service that can be requested
from an object to effect behavior.
The visible behavior consists its input and output
interfaces.
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:20 AM.
Slide 19
The Object
as seen by the Collaboration
Object A
Object B
Port Message
IN
Methods
TO-B
toB
toC
TO-C
Variables
IN
TO-C
toC
Object C
Methods Variables
Message
Message
triggers method
causes response
The What, Why and How of the UML Collaboration
Message
© Trygve Reenskaug 2000
IN
Methods Variables
5/29/2016 3:32:21 AM.
Slide 20
An instance level
collaboration
Bjarne
Gina
father
mother
1: cashRequest($25)
2: cashReceived($25)
Trygve
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:21 AM.
Slide 21
An instance level
sequence diagram
Trygve
Gina
cashRequest($25)
cashReceived($25)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:23 AM.
Slide 22
Collaboration
definition
A Collaboration describes how a number of
objects work together for a common purpose.
• What are the objects ?
• What are the responsibilities of each object in
the context of the collaboration purpose ?
• What are the links that connect the objects
into a communicating whole ?
• How are messages flowing between the objects
to achieve the common purpose ?
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:24 AM.
Slide 23
Exercise
Make your own object structure
Describe a number of objects that work together.
Purpose: to run an e-bookshop.
• What are the objects ?
• What are their responsibilities ?
• What are the links that connect them ?
• How are messages flowing between the objects?
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:24 AM.
Slide 24
Activity network planning
Our main example
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:24 AM.
Slide 25
Exercise
The example Activity Network
Activity-B
7 (4) 10
Activity-D
14 (3) 16
Activity-A
1 (6) 6
Activity-F
18 (2) 19
Activity-C
7 (7) 13
Activity-E
14 (4) 17
Completion time
Duration
Start time
What are the objects?
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:24 AM.
Slide 26
The example Activity Network
Objects and Interaction
fL(t) =
Project
public void
frontLoad (int time )
0
--20
Activity-B
Activity-A
1
(6)
6
Activity-D
4:fL(10)
7
(4)
10
14
(3)
16
Activity-F
Activity-C
Activity-E
18
(2)
19
7
(7)
13
14
(4)
17
The What, Why and How of the UML Collaboration
6:fL(13)
© Trygve Reenskaug 2000
5/29/2016 3:32:25 AM.
Slide 27
The example Activity Network
Message Sequence Chart
Project
Activity
-A
Activity
-B
Activity
-C
Activity
-D
Activity
-E
Activity
-F
fL(0)
fL(6)
fL(6)
fL(10)
fL(13)
fL(13)
fL(16)
fL(17)
fL(19)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:25 AM.
Slide 28
Essential questions
answered by the Collaboration
•
•
•
•
•
What is the purpose ?
What are the objects ?
What are their responsibilities ?
How are they interconnected ?
How do they interact ?
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:25 AM.
Slide 29
Specification level collaboration
ClassifierRole definition
• A ClassifierRole is a named slot
for an object participating in a
Collaboration.
• Object behavior is represented by
its participation in the overall
behavior of the Collaboration.
• Object identity is preserved
through this constraint:
"In an instance of a collaboration,
each ClassifierRole maps onto at
most one object."
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:25 AM.
Slide 30
Specification level collaboration
a simple example
/ Father
father
/ Mother
1
1
mother
1: cashRequest(amount)
*
*
2. cashReceived(amount)
/ Child
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:26 AM.
Slide 31
A specification level
sequence diagram
/ Child
/ Mother
cashRequest(amount)
cashReceived(amount)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:26 AM.
Slide 32
Specification level Collaboration
Frontloading Use Case
/ F-Pred
fL(t1)
/ F-Act
/ F-Succ
fL(t2)
*
*
"In an instance of a collaboration, each ClassifierRole
maps onto at most one object.”
A many-relation (*) means that
the role represents a typical member of the set
All other members behave correspondingly
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:26 AM.
Slide 33
What roles are the objects playing?
Predecessor
Project
Activity
/Predecessor
/Successor
Successor
Activity-A
/Predecessor
/Activity
/Successor
Activity-B
/Predecessor
/Activity
/Successor
Activity-D
/Predecessor
/Activity
/Successor
Activity-C
/Predecessor
/Activity
/Successor
Activity-E
/Predecessor
/Activity
/Successor
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
Activity-F
/Predecessor
/Activity
/Successor
5/29/2016 3:32:26 AM.
Slide 34
Specification level Collaboration
Frontloading Sequence Diagram
/ F-Pred
/ F-Act
/ F-Succ
fL(t1)
fL(t2)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:26 AM.
Slide 35
Tutorial Plan
•
Introduction
• The UML collaboration
• Typing AssociationEndRoles
specifies classes.
•
•
•
•
Specialization of a collaboration
System behavior, messages and interfaces
Information hiding & component technology
Summary and conclusion
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 36
Typing the out baskets
(AssociationEndRoles)
/ Father
/ Mother
father
mother
«Interface»
Child_to_Mother
cashRequested(amount)
«Interface»
Mother_to_Child
/ Child
The What, Why and How of the UML Collaboration
cashReceived(amount)
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 37
Typing the out baskets
“Lollipop Notation”
/ Father
/ Mother
«Interface»
Mother_to_Child
cashReceived(amount)
/ Child
The What, Why and How of the UML Collaboration
«Interface»
Child_to_Mother
cashRequested(amount)
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 38
Interfaces in the
Basic scheduling collaboration
The interfaces specify minimal requirements
to receiving classes
/ F-Pred
/ F-Act
/ F-Succ
«Interface»
Frontload
«Interface»
Backload
frontLoad(t)
backLoad(t)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 39
Possible implementations of the
Basic scheduling collaboration
The interfaces specify minimal requirements
to receiving classes
/ F-Pred
/ Predecessor
:Activity, Project
/Activity
F-Act
/:Activity
/ F-Succ
/ Succcessor
:Activity, Project
backLoad(t)
frontLoad(t)
backLoad(t)
frontLoad(t)
«Interface»
Frontload
«Interface»
Backload
frontLoad(t)
backLoad(t)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 40
Exercise: Define class Activity
in your favourite language
The interfaces specify minimal requirements
to receiving classes
/ F-Pred
/ Predecessor
:Activity, Project
/Activity
F-Act
/:Activity
/ F-Succ
/ Succcessor
:Activity, Project
backLoad(t)
frontLoad(t)
backLoad(t)
frontLoad(t)
«Interface»
Frontload
«Interface»
Backload
frontLoad(t)
backLoad(t)
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 41
Enterprise Java Bean
Application Assembler perspective
/ WEB
Browser
Information Bus
/ Applet
(End user tool)
/ Name
Server
/ Booking
Home
/ Booking
Object
4: getRooms();
/ Room
Chooser
Factory object
/ Booking
Bean
5: getRooms();
Java Beans
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:27 AM.
Slide 43
Highlight Collaboration
Hide implementation
/ WEB
Browser
/ Name
Server
The object
+ has
responsibility
/ Booking
object
Home its Factory
+ knows
collaborators
+ is robust
Nobody knows everything!
/ Applet
(End user tool)
Information Bus
Code
is
invisible!
/ Booking
Object
4: getRooms();
/ Room
Chooser
/ Booking
Bean
Objects 5: getRooms();
References
Interfaces
are visible!
Java Beans
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:28 AM.
Slide 44
Tutorial Plan
•
Introduction
• The UML collaboration
•
Typing AssociationEndRoles specifies classes.
• Specialization of a collaboration
•
•
•
System behavior, messages and interfaces
Information hiding & component technology
Summary and conclusion
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:28 AM.
Slide 45
Generalization of Collaborations
OOram Synthesis
Collaboration
for
Use case / operation
Use Case 1
Collaboration
for
Use case / operation
Use Case 2
Object
A
Object
B
The What, Why and How of the UML Collaboration
Object
C
Object
D
© Trygve Reenskaug 2000
5/29/2016 3:32:28 AM.
Slide 46
Example
illustrating the definition
/Root
/SuperNode
1
1
*
*
/Node
/SubNode
1
*
/Leaf
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:28 AM.
Slide 47
Planning Network
with Resources
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:28 AM.
Slide 48
Exercise
Activity planning with resources
Planning with resources
Use Cases:
• Frontloading
• Resource allocation for single activity
•For last use case:
+What are the objects ?
+What are their responsibilities ?
+How are they interconnected ?
+How do they interact ?
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:28 AM.
Slide 49
Activity planning
Resource Allocation Use Case
alloc() = public void allocate (Activity act, int earlyStart, int duration)
reserv() = public void reserved (int start, int end)
/ R-Act
1: alloc()
*
2: reserv()
1
/ R-Res
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:29 AM.
Slide 50
Specialization of Collaboration
Frontloading with resources
1: fL(t1)
/ F-Pred
*
2: fL(t2)
/ F-Act
1: fL(t1)
/ C-Pred
*
*
/ F-Succ
2: fL(t2)
//Activity
C-Act
1
1.1: alloc()
*
/ C-Succ
1.2: reserv()
/ R-Act
*
Synthesized
model
/ C-Res
1:
alloc()
1
2:
reserv()
*
/ R-Res
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:29 AM.
Slide 51
Exercise:
Specialization of Classes
1: fL(t1)
/ F-Pred
*
1: fL(t1)
/ C-Pred
*
/ F-Act
: FActivity
2: fL(t2)classes FActivity
and/ F-Succ
RActivity exist
*
Define class CActivity
/ C-Act
2: fL(t2)
/ Activity
: CActivity
1
1.1: alloc()
*
/ C-Succ
1.2: reserv()
*
Synthesized
model
/ C-Res
/ R-Act
: RActivity
1:
alloc()
1
2:
reserv()
*
/ R-Res
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:29 AM.
Slide 52
Tutorial Plan
•
Introduction
• The UML collaboration
•
•
Typing AssociationEndRoles specifies classes.
Specialization of a collaboration
• System behavior, messages and
interfaces
•
•
Information hiding & component technology
Summary and conclusion
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:30 AM.
Slide 54
Role and system behavior
The Collaboration
/ File
1
start()
read()
write()
stop()
1
/ Master
1
fileStarted()
runCompleted()
fileStopped()
1
*
/ Slave
*
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
run()
5/29/2016 3:32:30 AM.
Slide 55
Role and system behavior
Sequence Diagram
/Master
/File
/Slave
start()
fileStarted()
run()
read()
readDone()
write()
writeDone()
runCompleted()
stop()
fileStopped()
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:30 AM.
Slide 56
Role and system behavior
Role State Machines
/ File
/ Master
Initial
Idle
start/
open file;
master.fileStarted();
Initial/File.start();
WaitStart
fileStarted
/Slave.run();
write
/write();
Slave.writeDone();
Ready
read
/read();
Slave.readDone();
stop
/closeFile;
Master.fileStopped();
Done
WaitComplete
/ Slave
runCompleted
/File.stop();
Initial
Idle
run/File.read();
Stopping
fileStopped
readDone
/File.write();
final
The What, Why and How of the UML Collaboration
Editing
writeDone
/Master.runCompleted();
done
© Trygve Reenskaug 2000
5/29/2016 3:32:30 AM.
Slide 57
Role and system behavior
System State Machine
Initial->File.start();
Master-WaitStart & File-Idle & Slave-Idle
File start / open file; Master.fileStarted;
Master-WaitStart & File-Ready& Slave-Idle
Master fileStarted / Slave.run();
Master-WaitComplete & File-Ready & Slave-Idle
Slave run / File.read()
Master-WaitComplete & File-Ready & Slave-Editing
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:31 AM.
Slide 58
Tutorial Plan
•
Introduction
• The UML collaboration
•
•
•
Typing AssociationEndRoles specifies classes.
Specialization of a collaboration
System behavior, messages and interfaces
• Information hiding & component
technology
•
Summary and conclusion
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:31 AM.
Slide 59
Make IT so simple that even a
programmer can understand IT
Edsger Dijkstra:
• Testing can only show the presence of bugs
• Testing can never show the absence of bugs
• The number of bugs in the system when you
deliver it is proportional to the number of bugs
found during testing
• The only way to avoid bugs
is not to put them in in the first place
• I.E., Keep It Simple And Stupid (KISS)
60.000 bugs removed from Windows2000 during testing
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:31 AM.
Slide 60
Separation of Concerns
Two object-oriented techniques
• Components separate on services.
A component offers certain services
(operations) to its clients while it hides the
realizations of these services.
• Collaborations separate on system
behavior.
A collaboration model describes how slices of
selected objects realize use cases.
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:31 AM.
Slide 61
Horizontal Separation of concern
Cluster objects into “super-objects”
The (EJB) Component ~~ UML Subsystem:
•
A Component has a single access point (an object ID) and offers a
well-defined interface to its clients.
•
A Component is reused by cloning
•
A Component does not make assumptions about its clients
•
A Component plays a standardized role within a container
•
Tools are used to deploy components and compose systems
•
Components can contain components
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:31 AM.
Slide 62
Horizontal Separation of Concern
Object clustering
«EJB»
BeanExample
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
UML 1.3 Subsystem
5/29/2016 3:32:31 AM.
Slide 63
Vertical Separation of Concern
Collaborations separate on behavior
Collaboration
for
Use case / operation
Use Case 1
Collaboration
for
Use case / operation
Use Case 2
Object
A
Object
B
The What, Why and How of the UML Collaboration
Object
C
© Trygve Reenskaug 2000
Object
D
5/29/2016 3:32:31 AM.
Slide 64
Virtual Roles
Four designs
«virtualRole»
/ViewPackage
«virtualRole»
/ModelPackage
/ ProjectView
/ ProjectModel
*
1
1
1
*
/ ActivityView
*
/ ActivityModel
*
The What, Why and How of the UML Collaboration
1
© Trygve Reenskaug 2000
5/29/2016 3:32:32 AM.
Slide 65
xxxxxxxxxxxxxxxx
«virtualRole»
/ViewPackage
«virtualRole»
/ModelPackage
/ ProjectView
/ ProjectModel
*
1
1
1
*
/ ActivityView
*
/ ActivityModel
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:32 AM.
Slide 66
UML Use Case Actors
models environment objects
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:32 AM.
Slide 67
VirtualRoles
Use Case system
«virtualRole»
/System
System
Function
Actor
The What, Why and How of the UML Collaboration
Actor
© Trygve Reenskaug 2000
5/29/2016 3:32:32 AM.
Slide 68
Virtual Interactions
- transfer information to view
- alert view of changes in model
«virtualRole»
/ View
The What, Why and How of the UML Collaboration
«virtualRole»
/ Model
© Trygve Reenskaug 2000
5/29/2016 3:32:32 AM.
Slide 69
Virtual Interactions
a la Catalysis
- transfer information to view
- alert view of changes in model
«virtualRole»
/ View
The What, Why and How of the UML Collaboration
«virtualRole»
/ Model
© Trygve Reenskaug 2000
5/29/2016 3:32:32 AM.
Slide 70
Tutorial Plan
•
Introduction
• The UML collaboration
•
•
•
•
Typing AssociationEndRoles specifies classes.
Specialization of a collaboration
System behavior, messages and interfaces
Information hiding & component technology
• Summary and conclusion
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:33 AM.
Slide 71
Four Concepts
represents Classifier
Role
Class
specifies
instantiates
Object
implements
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
Interface
5/29/2016 3:32:33 AM.
Slide 72
To sum up
• Collaborations specify system behavior
• Collaborations model system at run-time
Community of interacting objects
• Collaborations model open systems
Environment and core roles
• ClassifierRole defined in terms of Collaboration instance
"In an instance of a collaboration, each ClassifierRole maps
onto at most one object."
Roles are not types, but can be typed
• Separation of concern: Decomposition of roles
– Horizontal: component --> UML Subsystem
– VirtualRole: UML package of ClassifierRole
– Vertical: Use Case --> Collaboration
• Virtual Interaction: UML Comment
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:33 AM.
Slide 73
Make IT so simple that even a
programmer can understand IT
Edsger Dijkstra:
• Testing can only show the presence of bugs
• Testing can never show the absence of bugs
• The number of bugs in the system when you
deliver it is proportional to the number of bugs
found during testing
• The only way to avoid bugs
is not to put them in in the first place
• IBM: Keep It Simple And Stupid (KISS)
60.000 bugs removed from Windows2000 during testing
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:32:33 AM.
Slide 74
What is a Component ?
Object pluggable on a backplane
Objects
Collaboration paths
Backplane
(Container)
Operating
System
Net
Hardware
The What, Why and How of the UML Collaboration
Thanks to Øystein Myhre for this illustration
© Trygve Reenskaug 2000
5/29/2016 3:32:33 AM.
Slide 75
Example:
Reuse language component
Language component
spell check
and
grammar
Word
processor
New Order entry system
with a text field
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:33:25 AM.
Slide 76
Make IT simple so that
Programmers and Users can master it
Focus on:
•Objects !
•Responsibilities !
•Message paths !
•Interfaces !
•Collaborations !
Invisible:
Challenge: Manage complexity
Code
Communication
olution: Objects & Collaboration
etc.
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:33:26 AM.
Slide 77
More details ….
•
http://www.ifi.uio.no/~trygver
where I work with an example development
also see "documents", particularly "UML Collaboration and OOram
semantics"
•
Reenskaug, Wold, Lehne: Working With Objects. Manning/Prentice Hall 1996.
ISBN 0-13-452930-8
The reference work (out of print)
•
Egil P. Andersen: Conceptual Modeling of Objects. A Role Modeling Approach. Dr
Scient thesis. Dept. of Informatics, University of Oslo. 4 November 1997.
The theory of role modeling
ftp://ftp.nr.no/pub/egil/ConceptualModelingOO.ps.gz
•
Trygve Reenskaug : Working with objects: A three-model architecture for the
analysis of information systems. JOOP May 1997.
•
Unified Modeling Language (UML). Object Management Group. Version 1.3,
September 1, 1997. Document numbers 97-08-02 through 97-08-05 define
version 1.1 (versions 1.2 and 1.3 under development):
http://www.omg.org/
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:33:30 AM.
Slide 78
The What, Why and How of the UML Collaboration
© Trygve Reenskaug 2000
5/29/2016 3:33:30 AM.
Slide 79
Download