can I use fork to present multiple actions within a same method?
kevin ou
Greenhorn
Joined: Feb 15, 2003
Posts: 23
posted
0
Hi all,
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.
Kevin
Sathya Srinivasan
Ranch Hand
Joined: Jan 29, 2002
Posts: 379
posted
0
You can use a self-call (looping line) in a sequence diagram to call a method of an object from another method of the same object.
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.
Sathya Srinivasan
Ranch Hand
Joined: Jan 29, 2002
Posts: 379
posted
0
Well,
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.
Simply draw a parallel bar with one arrow entering it and several, one for each line of logic, leaving it. At some other point you should join the logic streams, see http://www.agilemodeling.com/style/activityDiagram.htm for modeling guidelines.
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?
Scott Ambler
author
Ranch Hand
Joined: Dec 12, 2003
Posts: 608
posted
0
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).