OOAD: Dynamic Interaction Modeling: Presenter: Dr. Ha Viet Uyen Synh
OOAD: Dynamic Interaction Modeling: Presenter: Dr. Ha Viet Uyen Synh
OOAD: Dynamic Interaction Modeling: Presenter: Dr. Ha Viet Uyen Synh
INTERACTION DIAGRAM
Role of Interaction Diagrams in UML
Interaction Diagram
Interaction diagrams describe exemplary how groups of
objects collaborate in some behavior.
Activation Note
Sequence Diagram Notations
The second sequence is called when the balance is not greater than or
equal to the amount because of the \[else\] guard. In alternative
combination fragments, the \[else\] guard is not required; and if an
operand does not have an explicit guard on it, then the \[else\] guard
is to be assumed.
Option
According to the sequence diagram in Figure 9, if a student’s past due
balance equals zero, then the addStudent, getCostOfClass, and
chargeForClass messages are sent. If the student’s past due balance
does not equal zero, then the sequence skips sending any of the
messages in the option combination fragment.
Loop
Referencing another sequence
diagram
Break
Parallel
Concurrent Processes and Activations
UML offers diagram elements to show concurrent
processes explicitly within sequence and collaboration
diagrams.
Activation:
• indicates whenever a method is active,
• shows methods which are waiting for returns.
Asynchronous message:
• allows the creation of new threads or objects,
• communicates with already running threads or objects.
Deletion:
• occurs by self destruction of threads or objects,
• can be initiated by external messages.
Concurrency in Sequence Diagrams
Example:
- A bank transaction transfers $100 from bank account #123 to
#456.
• Withdraw $100 from bank account #123.
• Deposit $100 at bank account #456.
A complete
SSD for the
RMO use
case Create
new order
28
Summary
Collaboration Diagrams
Dynamic behavior of objects can, in addition to
sequence diagrams, also be represented by
collaboration diagrams.
The online stock broker first verifies the order against the
customer’s account, then executes it with the stock
exchange.
hvusynh@hcmiu.edu.vn