For instance, if I have a method A() and within method A, I will have several methods like A1(),A2()... etc. So my question is, how to present these methods (A1(),A2()) for method A() in the Activity diagram? Should I use fork? Thanks.
i need to present it in the Activity Diagram. Moreover, I need to mention that A1() or A2() methods are not concurrent, they are just in sequence.
Joined: Jan 29, 2002
Sequence diagrams do exactly that - mention methods in sequence. Activity diagrams are typically used to display logic within a class (as a part of state transition - some consider it as an alternate view to state diagrams). I have personally used it to show conversation for use cases.
The fork (techically, the decision box) is used like the 'diamond' in a flowchart, which typically represents an if...then...else situation.
From what you say, I don't think that's what you want to represent.
First of all thanks for all the inputs, however as I am concerning, the fork is used to present concurrent threads. In my case, A1(),A2() in method A() are not concurrent. They are all called from A(). So the question is, is it appropriate to use fork for this kind of calling methods?
Joined: Dec 12, 2003
If they're not concurrent then you shouldn't use forks.
Your next best option is to simply have flows from the invoking activity to the sub-activities. If all activities must end before continuing then have them go into a join.
However, it's beginning to sound as if activity diagrams are not the way to go in this case, that you should consider another diagram (sequence diagrams come to mind).
subject: can I use fork to present multiple actions within a same method?