1
votes

Suppose I have an html form that checks validity of several fields. They do not occur in parallel.

  • Is the use of a fork and join wrong in this case?
  • Use a merge and decision diamond with several decisions leaving and several decisions merging?
  • How does activity diagram differ from sequence diagram?
  • Would I just have one activity name "check values" vs several discrete activities "check val1", "check val2"?
1

1 Answers

1
votes

No, fork and join are exactly made for this purpose. A fork will create as many tokens as it has outgoing control flows. These tokens will travel on until they reach either an end node where they are destroyed, or they reach a join where they wait until all incoming control flows present a token. Only then a single token will continue to travel on. NB: fork and join are actually the same thing and only distinguished by the number of control flows entering or leaving. You can also create a join-fork in a single bar, but that's not recommended for readability. So a join has n>1 incoming and one outgoing control flows and a fork vice versa.

A diamond in contrast will process only a single token at a time, no matter where they come from.

There is not really a semantical difference between AD and SD. However, a SD targets more a technical readership while ADs are more likely read by business people. The focus of both is a bit different.

Whether you create a single or multiple diagrams depends on the complexity of the whole thing. You can also create coarse overview diagrams and focus on details in sub-diagrams.