Interactions
- Objects and Roles
- Links
- Messages
- Sequencing
- Creation, Modification and Destruction
- Common Modeling Techniques
- Objects are either concrete things or prototypical things
- Concrete thing represents something in real world while prototypical thing stands for any object of a given class
- In interactions, the interactors are usually prototypical things that play particular roles
- When we say "Dhawan is the man of the match", we are referring to a particular instance of the player class. This is an example for concrete things
- When we say "a player is selected on merit", we are referring to any instance of player class. This is an example for prototypical things
Link is
- Semantic connection among objects
- Instance of an association, i.e., the association between instances of two classes represents a link
- Association: Object is visible by association
- Self: Object is visible because it is the dispatcher of the operation
- Global: Object is visible because it is in enclosing scope
- Local: Object is visible because it is in a local scope
- Parameter: Object is visible because it is a parameter
Messages
Indicates an action to be done (requested by the sender to the receiver)
Different types of messages are
- Call: Invokes an operation on an object; an object may send a message to itself, resulting in the local invocation of an operation
- Return: Returns a value to the caller
- Send: Sends a signal to an object
- Create: Creates an object
- Destroy: Destroys an object. An object may destroy itself
Sequencing
- A sequence is a stream of messages exchanged between objects
- Sequence must have a beginning Messages are ordered in sequence by time and are visualized by prefixing the message with a sequence number with a colon separator
- Flow of control are two types:
A flat flow of control is rendered by using a stick arrowhead
Creation, Modification and Destruction
Enabled by adding the following constraints to the element
- New - This instance or link is created while the closing interaction is executed
- Destroyed - This situation or link is destroyed before the closing interaction is completed
- Transient- This situation or link is created while the closing interaction is executed, but destroyed before the execution is completed
Modeling a Flow of Control
To model a flow of control:
- Determine what interaction must be modeled
- Analyze which objects take part in the interaction, set their initial properties, which includes their attribute values, state, and role
- If the model highlights the structural organization of these objects, identify the links that associate them which are relevant to the paths of communication
- Indicate the nature of the links using the UMLs standard stereotyped and constraints wherever necessary
- Specify the messages from object to object in time order
- Distinguish the different kind of messages wherever necessary. Also, include parameters and return values to pass on the interaction details
- Enhance each object with its state and role at every stage in time
Interaction at a Glance