nus-cs2103-AY1819S2 / forum

CS2103/T discussion forum
6 stars 1 forks source link

Correct notation for activity diagram #89

Open lingyanhao opened 5 years ago

lingyanhao commented 5 years ago

image

This diagram was taken from the textbook. It was explained that this is a correct diagram a branch can join other branches.

My question: why is there no merge node and what are merge nodes used for? In all the other examples, when branches combine, a merge node is always used. Why is the merge node not needed here?

lingyanhao commented 5 years ago

Sorry for bumping this thread, I want to ask why a merge node is not required at B1

ccristina commented 5 years ago

Hi,

You can add a merge node every time when you merge the branches after a decision. However, sometimes you might not be able to structure the diagram such that you can use a merge node.

However, it is accepted to merge using another type of node (i.e. action node in this case). For this diagram, branch [high] merges into branch [input>5].

If you want to use a merge node, you need to have two B1 nodes and two B2 nodes, and the diagram will be different. Could you sketch the diagram for that case?

Best regards, Cristina.