Closed lyndonlim27 closed 1 year ago
I was wondering if perhaps the partitions' executions are optional to account for the scenario of an 'if-else if' without a closing 'else'? In that case, if none of the conditions match then none of the partitions would be executed.
@lyndonlim27 Unlike in activity diagrams in which exactly one path needs to be taken (or else the execution gets stuck), it is fine in alt
frames to not execute any partitions. This gives us more flexibility, as there are cases which none of the conditional code blocks are executed e.g., switch-case
with no default
branch (and the example @nramapurath mentioned).
I see. Thank you prof!
In the textbook it says that it is acceptable for none of the alternative partitions to be executed. But I thought alternative paths is like an if else statement where it is guaranteed to execute one and only one partition.