Google Answers Logo
View Question
 
Q: Unified Modeling Language - software modeling ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Unified Modeling Language - software modeling
Category: Computers > Software
Asked by: tomking-ga
List Price: $25.00
Posted: 04 Jan 2006 12:56 PST
Expires: 03 Feb 2006 12:56 PST
Question ID: 429124
Does the UML 2 Activity Diagram support looping?  If so, is there an example?

Request for Question Clarification by maniac-ga on 04 Jan 2006 18:10 PST
Hello Tomking,

Hmm. I have an answer / example, but I don't feel its worth $25. If
you like the answer, please adjust the price to the worth of the
answer to you and post a clarification request.

Yes - looping is supported in UML 2 activity diagrams. There is a good
explanation of these diagrams, including a looping example at:
  http://www.agilemodeling.com/artifacts/activityDiagram.htm

Look in the upper left of the hand drawn figure 1 with the sequence
  Start -> (loop start) Fill out Forms -> Inspect Forms -> Condition (loop end)
which loops until the condition of "correct forms" is satisfied.

There is a streamlined version in figure 2 that also loops / removes
the condition and clarifies which person (or the system) does what
activities.
  --Maniac

Clarification of Question by tomking-ga on 05 Jan 2006 08:33 PST
Hi Maniac,

Yes, I saw Scott's example, but the question is whether UML 2 has a
standard for looping including the standard way to route the line that
loops back to an activity - where does the arrowhead go (e.g., to the
middle of an activity box, to the middle of the line leading into the
box, etc.) and how does the line route (e.g., through the middle of
the Activity Diagram, around the outside, etc.)?  I have seen the
"expansive node" convention in which the activity is shown in a
special way to indicate iteration, but that is complex and not easily
understood by a business analyst.  So what I'm looking for is a simple
line looping back to an earlier activity (action or conditional) and
whether that is supported by UML 2 and an example of such a diagram
showing the detail of how the line is shown, routed and attached. 
Thanks, I really appreciate your help!

Tom King

Request for Question Clarification by maniac-ga on 05 Jan 2006 19:36 PST
Hello Tomking,

Well, the UML 2.0 standard at
  http://www.omg.org/docs/formal/05-07-04.pdf
in section 12.3.5 briefly states in part
  "An activity edge is notated by a stick-arrowhead line connecting
two activity nodes."
So according to that, the arrowhead goes to a box, not to another
line. That pretty much matches conventions from earlier diagram
methods that UML evolved from, or for that matter going back to hand
drawn flow charts. That's not to say that people don't draw diagrams
connecting to lines with an implied connector at at point.

There is no apparent standard for where you route the line. A common
method for state diagrams is to draw the loop back in parallel.
Something like:

  A-->B
  A<--B

(either straight or bended - there are several examples in the
standard) Adopting a similar method for simple loops in activity
diagrams would certainly be relatively easy to read and understand.
Examples of diagrams including loops are on page 312 (trouble ticket),
322 (proposal review), and 361 and 363 (building components). All of
these examples are admittedly quite simple but if you find you have
problems with "where to route the line", you may consider this a side
effect of a diagram that is "too complex" to understand.
[I personally prefer more diagrams with fewer boxes / lines because
they help focus your attention]

I find it a little odd that the standard has a "loop node" described
on pages 371 through 373 but there are no examples to review. [yes - I
read its a specialization of a structured activity node, but there are
no examples there either] It is certainly a nice pattern to follow if
it helps.

The other consideration you may want to review are the capabilities of
the drawing tool you are using. If using a specialized tool such as
those listed at:
  http://www.uml.org/#Links-UML2Tools
would certainly help standardize your drawings (though the diagrams
you get may appear "ugly" because they implement the line routing in a
naive manner).

It may also be important how the diagrams are constructed if using a
back end code generator. The code generator may have constraints on
how the diagrams are constructed (though I expect this more a problem
with flow and state diagrams than an activity one).
  

  --Maniac

Clarification of Question by tomking-ga on 06 Jan 2006 08:44 PST
Hi Maniac,

Thanks, that's very helpful information and certainly worth the $25!

Best regards,
Tom King
Answer  
Subject: Re: Unified Modeling Language - software modeling
Answered By: maniac-ga on 06 Jan 2006 17:57 PST
Rated:5 out of 5 stars
 
Hello Tomking,

Thanks for the kind words. Let me summarize what I had stated before
as a proper answer.

Yes - looping is supported in UML 2.0 activity diagrams. See
  http://www.omg.org/docs/formal/05-07-04.pdf
for a copy of the standard used for the references below.

First, there is a "loop node" described on pages 371 through 373 (alas
- without examples).

Second, there are several examples of activity diagrams on pages page
312 (trouble ticket),
322 (proposal review), and 361 and 363 (building components). All of
these are quite simple and show the line showing the loop in a
straight forward manner. There is apparently no "standard" way to
route the loop line - I suggest using a convenient path or perhaps
restructuring the diagram slightly to make the loop easier to
visualize.

Third, there are additional examples such as
  http://www.agilemodeling.com/artifacts/activityDiagram.htm
which shows a set of hand drawn diagrams that include loops as part of
the activity diagram.

Search phrases used to help prepare the answer included:
  UML
  UML activity diagram
Plus a review of books like "Object Oriented Modeling and Design" by
Rumbaugh, Blaha, Premerlani, Eddy, & Lorensen and "Modern Structured
Analysis" by Yourdon.

Good luck with your work.

  --Maniac
tomking-ga rated this answer:5 out of 5 stars
Excellent responsiveness and knowledge.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy