activity diagram in uml regarding parallel activities

跟風遠走 提交于 2019-12-11 08:24:32

问题


I had a doubt regarding parallel activities that occur in the system. How can we represent those in the diagram? Is there always a need of fork or the decision element can also be used? Eg.: The user can choose among "Add Book" , "Search Book", "Search User" and "Update profile". So after the user logs in the system he can choose among the above operations.

Below is the image of my activity diagram.

回答1:


According to http://www.uml-diagrams.org/activity-diagrams-reference.html the

..Fork node is a control node that has one incoming edge and multiple outgoing edges and is used to split incoming flow into multiple concurrent flows..

and

..Decision node is a control node that accepts tokens on one or two incoming edges and selects one outgoing edge from one or more outgoing flows..

In your case the 1 user will select and perform 1 of the possible actions and do it 1 at a time. The user will not use 2 or more mice or 2 or more browser tabs to use the application concurrently..




回答2:


I'll expand a bit on xmojmr's answer. As xmojmr says, forks and joins are for simultaneous and separate activities that have to be done before you can continue with something else.

Your diagram is saying that in order to do a Select Operation, you have to do an Add Book, a Search Book, a Search User Profile and a View Profile. You have to do all four of them, every time, and when all four of them are completed, you do a Do You Want to Continue. Also, Adding a Book requires that you add a book, delete a book, and view a book list, all three.

This is obviously not correct. In both cases, you're choosing from one of a group of possiblities. So, you're looking for a decision as xmojmr also says.

Now, an example of when you would use forks and joins would be in performing a background check. You would check a number of sources, for example a fingerprint database, a DMV check, Photo matching database, and criminal records database. You'd have to check all of these before you had a complete background check. However, none of the four are dependent on the others, and each one can run concurrently with the others. This is the sort of scenario that uses forks and joins.



来源:https://stackoverflow.com/questions/26681136/activity-diagram-in-uml-regarding-parallel-activities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!