Interaction Diagrams
An interaction diagram reveals an interaction, which consists of a set of objects and their respective relationships. It also includes the messages that may be transmitted among them.
Interaction Diagrams can be classified in to two categories:
1) Sequence Diagrams
2) Collaboration Diagrams
Sequence Diagram
A sequence diagram emphasizes the time ordering of messages between objects.
Objects
- Object naming
- Name classes consistently with your class diagram (same classes)
- Include instance names when objects are referred to in messages or when several objects of the same type exist in the diagram
- The life-line represents the object's life during the interaction
![Sequence Diagram cse study zone,estudies4you,Interaction Diagrams,uml Interaction Diagrams,Interaction Diagrams in uml.ooad Interaction Diagrams,Interaction Diagrams in ooad,types of Interaction Diagrams in uml,uml Interaction Diagrams types,Sequence Diagrams in uml,uml Sequence Diagrams,Sequence Diagrams in ooad,ooad Sequence Diagrams,](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6hJAT2ya_c3igDsBY_Z1r-RrDhYvr9pLex2V0KwkMgpR_S0VHZGWMRLX8FWZzzo8UIz4CUgXgLyBq-YmvO_3LmYj7506e8tBW2T5m3Agp14cxWLafl5bTgCI4u3GbR-kiv668Lvpfn_gF/s1600/Sequence+diagram+in+uml.png)
Messages:
| ![]() |
- A message is represented by an arrow between the life lines of two objects
- The time required by the receiver object to process the message is denoted by an activation-box
- A message is labeled at a minimum with the message name
- Arguments and control information (conditions, iterations) may be included.
Optionally indicated using a dashed arrow with a label indicating the return value
- Model a return value only when you need to refer to it elsewhere
Example: As a parameter passed in another message
- Prefer modeling return values as part of a method invocation
Example: ok = isValid()
Condition: | ![]() |
syntax: ‘[‘expression ']' message-label
The message is sent only if the condition is true.
Example:
Iteration
syntax: * [‘[‘ expression ‘]’'] message-label
The message is sent many times to possibly multiple receiver objects.
![cse study zone,estudies4you,Interaction Diagrams,uml Interaction Diagrams,Interaction Diagrams in uml.ooad Interaction Diagrams,Interaction Diagrams in ooad,types of Interaction Diagrams in uml,uml Interaction Diagrams types,Sequence Diagrams in uml,uml Sequence Diagrams,Sequence Diagrams in ooad,ooad Sequence Diagrams,](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7LjK5uz_kX7VYQVfmWszJCRQAN3IOZUHVKKYqyMgnzdcRMam23UNSvJ-WOt8pKnbDflSnb3bSx_mNMd82VaviT9vjhC9uoilVrXEty8kTiTRQPdOL8ohoS9DtzlNUoi3iCd1d5CBLWW9I/s1600/Collaboration+diagram.png)
Operator
|
Meaning
|
alt
|
Alternative multiple fragments: Only
the one whose condition is true will execute
|
opt
|
Optional: The fragment executes only
if the supplied condition is true. Equivalent to an alt only with one trace
|
par
|
Parallel: Each fragment is run in
parallel
|
loop
|
Loop: The fragment may execute
multiple times, and the guard indicates the basis of iteration
|
region
|
Critical region: The fragments can
have only one thread executing it at once
|
neg
|
Negative: The fragments shows an
invalid interaction
|
ref
|
Reference: Refers to an interaction defined
on another diagram. The frame is drawn to cover the lifelines involved in the
interaction. You can define parameters and a return value
|
sd
|
Sequence diagram: Used to surround an
entire sequence diagram.
|
- A collaboration diagram emphasizes the organization of the objects that participate in an interaction
- They are isomorphic to sequence diagrams, i.e., any sequence diagram can be written as collaboration diagram and vice versa
- Numbering of the messages can be flat
Example: 1,1, 1, 1.2, ... 2, 2.1, 2.2, ...
![UML Collaboration Diagram](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRSLeRpKohkXNZHveoAb0IEan7mziyZlw0KZo-L2tNlcVMENEE5Vu000_cAWEDQGRR90MubplKOt91XBJ8STMtB_y2_V7Z3NGMySSxHNjLSsyzJMH9cqcoE24_BPPkI6kVlDRGZtdd9zx0/s1600/uml+collaboration+diagram.png)
Uses
Interaction diagram is used:
- To model flows of control by time ordering
- To model flows of control by organization
Post a Comment
Post a Comment