• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can I use fork to present multiple actions within a same method?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
kevin ou
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are several examples of forks presented at http://www.agilemodeling.com/artifacts/activityDiagram.htm .

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.

- Scott
 
kevin ou
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).

- Scott
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic