Designing the Enterprise A hierarchy of Goals and Means

Download Report

Transcript Designing the Enterprise A hierarchy of Goals and Means

The semantics
of the
UML Collaboration
[email protected]
http://www.ifi.uio.no/~trygver
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 1
Legal Notice
This presentation is copyright
©1999 Trygve Reenskaug, Lasse Bjerde
Oslo, Norway.
All rights reserved.
Unauthorized reproduction prohibited.
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 2
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system behavior
• Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 3
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
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 4
Consider the Universe as a
Universe of objects
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 5
The object paradigm
is very simple
UMLObject-B
Class Abstraction cannot model
message sends.
Use UML Collaboration abstraction for
system modeling
IN
IN
OUT-B
OUT-C
OUT-C
Object-C
Methods Variables
Methods Variables
IN
Object-A
Message (operation)
triggers method
causes response
7/17/2015
Methods Variables
Trygve Reenskaug: Semantics of UML Collaboration
Slide 6
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system behavior
• Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 7
An Open System
For a given system,
the environment is the set of all objects
outside the system
whose actions affect it
or who are affected by the system,
and also those objects outside the
system whose attributes are changed
by its actions.
Etzioni: Modern Organizations
Prentice-Hall, 1964
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 8
Open systems
interact with environment objects
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 9
The collaboration is a topological model
of a system of objects
Collaboration
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 10
Typing
AssociationEndRoles
/ Father
/ Mother
Mother_Child_Intf
cashRequested()
Child_Mother_Intf
/ Child
7/17/2015
cashReceived()
Trygve Reenskaug: Semantics of UML Collaboration
Slide 11
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system behavior
• Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 12
Collaboration
(definition)
A Collaboration describes how a number of
objects work together for a common purpose.
The structural aspect is a description of the
responsibilities of each object in the context of
the overall purpose of the collaboration;
and also the links that connect the objects into a
communicating whole.
The dynamic aspect is a description of how
stimuli flow between the objects to achieve the
common purpose.
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 13
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."
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 14
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of Collaboration
instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
•
•
•
•
VirtualRole: package of ClassifierRole
Virtual Interaction: Comment
Collaboration specifies system behavior
Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 15
Separation of concern
Cluster objects into “super-objects”
The (EJB) Component:
•
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
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 16
Horizontal Separation of Concern
Object clustering
«EJB»
BeanExample
7/17/2015
UML 1.3 Subsystem
Trygve Reenskaug: Semantics of UML Collaboration
Slide 17
Vertical Separation of Concern
Collaborations separate on behavior
Collaboration
for
Use case / operation
UC1
Collaboration
for
Use case / operation
UC2
Object
A
7/17/2015
Object
B
Object
C
Object
D
Trygve Reenskaug: Semantics of UML Collaboration
Slide 18
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system behavior
• Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 19
Virtual Roles
Example Activity Network
Activity-B
8 (4) 12
Activity-D
13 (3) 16
Activity-A
5 (3) 8
Activity-F
20 (4) 24
Activity-C
8 (5) 13
Activity-E
13 (7) 20
Completion time
Duration
Start time
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 20
Virtual Roles
Four designs
«virtualRole»
/ViewPackage
«virtualRole»
/ViewPackage
/ NetworkView
/ NetworkModel
*
1
1
1
*
/ ActivityView
*
/ ActivityModel
*
7/17/2015
1
Trygve Reenskaug: Semantics of UML Collaboration
Slide 21
VirtualRoles
Use Case system
«virtualRole»
/System
System
Function
Traveler
7/17/2015
Paymaster
Trygve Reenskaug: Semantics of UML Collaboration
Slide 22
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system behavior
• Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 23
Virtual Interactions
- transfer information to view
- alert view of changes in model
«virtualRole»
/ View
7/17/2015
«virtualRole»
/ Model
Trygve Reenskaug: Semantics of UML Collaboration
Slide 24
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system
behavior
•
Proposed
metamodel
extension
Trygve
Reenskaug:
Semantics
of UML Collaboration
7/17/2015
Slide 25
Role and system behavior
The Collaboration
/ File
1
start()
read()
write()
stop()
1
/ Master
1
fileStarted()
runCompleted()
fileStopped()
1
*
/ Slave
*
7/17/2015
run()
Trygve Reenskaug: Semantics of UML Collaboration
Slide 26
Role and system behavior
Message Sequence
/Master
/File
/Slave
start()
fileStarted()
run()
read()
readDone()
write()
writeDone()
runCompleted()
stop()
fileStopped()
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 27
Role and system behavior
Role State Machines
/ File
Initial
/ Master
Initial/File.start();
WaitStart
fileStarted
/Slave.run();
WaitComplete
runCompleted
/File.stop();
Idle
start/
open file;
master.fileStarted();
write
/write();
Slave.writeDone();
Ready
read
/read();
Slave.readDone();
stop
/closeFile;
Master.fileStopped();
Done
/ Slave
Initial
Idle
run/File.read();
Stopping
fileStopped
final
7/17/2015
readDone
/File.write();
Editing
writeDone
/Master.runCompleted();
done
Trygve Reenskaug: Semantics of UML Collaboration
Slide 28
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
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 29
Summary
• Collaborations model run-time system
• Collaborations model open systems
• ClassifierRole defined in terms of
Collaboration instance
• Separation of concern:
– Horizontal: Subsystem object grouping
– Vertical: Collaboration on behavior
• VirtualRole: package of ClassifierRole
• Virtual Interaction: Comment
• Collaboration specifies system behavior
• Proposed metamodel extension
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 30
Metamodel extension for
Instance Level Collaboration
GeneralizableElement
(from Core)
classifier
Classifier
(from Core) 1..*
1..* base
Namespace
(from Core)
SpecificationCollaboration 1
(from Collaborations)
*
ClassifierRole
ownedElement (from Collaborations)
1..*
multiplicity: Multiplicity
1
ModelElement
(from Core)
*
InstanceCollaboration
(new)
7/17/2015
*
1..* Instance
*
(from Common Behavior) instance
roleInstance
Trygve Reenskaug: Semantics of UML Collaboration
Slide 31
Metamodel extension for
OCL Definition of Collaboration
context InstanceCollaboration inv:
self.specificationCollaboration.ownedElement->
forAll( c : ClassifierRole |
c.instance->select(i : Instance |
self.roleInstance->includes(i))->size <= 1)
My thanks to Jos Warmer
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 32
THANK YOU
7/17/2015
Trygve Reenskaug: Semantics of UML Collaboration
Slide 33