0
5.8kviews
Explain structured control in sequence diagram for conditional execution.

Subject: Object Oriented Modeling and Design

Difficulty: Medium

Marks: 4 Marks

1 Answer
0
403views

Structured control in sequence diagram: It defines statements or group of statements in a diagram which determines the sequence of execution of other instructions or statements.

Conditional execution:

  1. In sequence diagram conditional statements are used to check the condition.
  2. Alt operator is used to indicate the condition in sequence diagram. The body of the control operator is divided into multiple sub regions by horizontal dashed lines.
  3. Each sub region represents one branch of a condition. Each sub region has a guard condition. If the guard condition for a sub region is true, then that sub region is executed.
  4. At most one sub region may be executed.
  5. One sub region may have the special guard condition [else]. This sub region is executed if none of the other guard conditions are true.

Example

enter image description here

In the above example alt operator is used to show condition as amount >=balance. If the condition is true then, update operation will be perform on account object.If the condition is false then, else region executes if a message as insufficient funds from account object to bank object

Please log in to add an answer.