Presentation is loading. Please wait.

Presentation is loading. Please wait.

The semantics of the UML Collaboration

Similar presentations


Presentation on theme: "The semantics of the UML Collaboration"— Presentation transcript:

1 The semantics of the UML Collaboration
1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

2 Legal Notice This presentation is copyright
©1999 Trygve Reenskaug, Lasse Bjerde Oslo, Norway. All rights reserved. Unauthorized reproduction prohibited. 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

3 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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

4 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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

5 Consider the Universe as a Universe of objects
1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

6 The object paradigm is very simple
UML Class Abstraction cannot model message sends. Use UML Collaboration abstraction for system modeling Object-B IN OUT-B OUT-C Methods Variables IN OUT-C Object-C Methods Variables Object Orientation Encapsulation: Package data with methods; Collaborators only see object’s interfaces Object identity supports Distributed logic: everything happens within some object, nothing outside the objects Role models describe system behavior as object collaboration Role model synthesis: Inherit collaboration with roles and system behavior Essentially black box - implementation hidden/postponed Object-A IN Methods Variables Message (operation) triggers method causes response 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

7 Summary Collaborations model open systems
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

8 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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

9 Open systems interact with environment objects
1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

10 The collaboration is a topological model of a system of objects
1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

11 Typing AssociationEndRoles
/ Father / Mother Mother_Child_Intf cashRequested() Child_Mother_Intf cashReceived() / Child 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

12 Summary ClassifierRole defined in terms of Collaboration instance
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

13 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. 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

14 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." 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

15 Summary Separation of concern: Horizontal: Subsystem object grouping
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

16 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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

17 Horizontal Separation of Concern Object clustering
«EJB» BeanExample UML 1.3 Subsystem 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

18 Vertical Separation of Concern Collaborations separate on behavior
Collaboration for Use case / operation UC1 Collaboration for Use case / operation UC2 Object Object Object Object A B C D 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

19 Summary VirtualRole: package of ClassifierRole
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

20 Virtual Roles Example Activity Network
Activity-B Activity-D 8 (4) 12 13 (3) 16 Activity-A Activity-F 5 (3) 8 20 (4) 24 Activity-C Activity-E 8 (5) 13 13 (7) 20 Completion time Duration Start time 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

21 Virtual Roles Four designs
/ViewPackage «virtualRole» /ViewPackage / NetworkView / NetworkModel * 1 / ActivityView 1 * / ActivityModel 1 * * 1 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

22 VirtualRoles Use Case system
Function Traveler Paymaster 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

23 Summary Virtual Interaction: Comment
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

24 Virtual Interactions - transfer information to view
- alert view of changes in model «virtualRole» «virtualRole» / View / Model 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

25 Summary Collaboration specifies system behavior
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

26 Role and system behavior The Collaboration
/ File start() 1 read() write() stop() 1 / Master 1 fileStarted() runCompleted() fileStopped() 1 * / Slave * run() 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

27 Role and system behavior Message Sequence
/Master /File /Slave start() fileStarted() run() read() readDone() write() writeDone() runCompleted() stop() fileStopped() 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

28 Role and system behavior Role State Machines
Slave.readDone(); Idle start/ open file; master.fileStarted(); Ready stop /closeFile; Master.fileStopped(); / File Done Initial read /read(); write /write(); Slave.writeDone(); Stopping WaitComplete WaitStart / Master Initial/File.start(); fileStarted /Slave.run(); runCompleted /File.stop(); fileStopped final Idle done Editing run/File.read(); writeDone /Master.runCompleted(); readDone /File.write(); / Slave Initial 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

29 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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

30 Summary Proposed metamodel extension
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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

31 Metamodel extension for Instance Level Collaboration
classifier GeneralizableElement Namespace Classifier (from Core) 1..* (from Core) (from Core) 1..* base * ClassifierRole SpecificationCollaboration 1 ownedElement (from Collaborations) (from Collaborations) 1..* multiplicity: Multiplicity 1 ModelElement (from Core) * * 1..* Instance * InstanceCollaboration (from Common Behavior) instance (new) roleInstance 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

32 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 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration

33 THANK YOU 1/15/2019 Trygve Reenskaug: Semantics of UML Collaboration


Download ppt "The semantics of the UML Collaboration"

Similar presentations


Ads by Google