5/05/2009

Exercise 20-part6

F. Activity Diagram
I learn the activity diagram from visualcase (2009) web site

F1. Scope of activity diagram
An activity is the execution of a task whether it be a physical activity or the execution of code. Simply put, the activity diagram shows the sequence of activities.

F2. Elements of activity diagram
  • Start - each activity diagram has one start (see figure 1) at which the sequence of actions begins.


Figure 1. Start symbol of activity diagram

  • End - each activity diagram has one finish at which the sequence of actions ends. (See figure 2)


Figure 2. End symbol of activity diagram

  • Activity - ctivities are connected together by transitions. Transitions are directed arrows flowing from the previous activity to the next activity. They are optionally accompanied by a textual label of the form.(See figure 3)


Figure 3. Activity symbol of activity diagram

  • [guard] label - The guard is a conditional expression that when true indicates that the transition is taken. The label is also optional and is freeform.

  • Conditional behaviour - To show conditional behaviour use a branch and a merge. The top diamond is a branch and has only one transition flowing into it and any number of mutually exclusive transitions flowing out. That is, the guards on the outgoing transitions must resolve themselves so that only one is followed. (See figure 4.) The merge is used to end the conditional behaviour. There can be any number of incoming, and only one outgoing transition. (See figure 5.)

Figure 4. Branch condition symbol of activity diagram.




Figure 5. Merge condition symbol of activity diagram.


  • Parallel behaviour - To show parallel behaviour use a fork and a join. The fork (top) has one transition entering and any number of transitions exiting, all of which will be taken. The join (bottom) represents the end of the parallel behaviour and has any number of transitions entering, and only one leaving. (See figure 6.)

Figure 6. Parallel behaviour symbol of activity diagram.

References:
Visualcase (2009). "Visual Case Tool - UML Tutorial". Received 6th May, 2009 from URL -
http://www.visualcase.com/tutorials/activity-and-state-diagram.htm

沒有留言:

發佈留言