• 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

UML sequence diagram help

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's the non-programmer in me putting myself to shame. I don't know how to write UML sequence diagrams

I'm trying to write my first one to describe the flow of logic in a Java web application framework. In words it goes like this:

Request hits front controller
Front controller uses an ActionDispatcher (helper) to forward the request to an ActionController
ActionController may (optionally) ask the ActionDispatcher to foward the request elsewhere (repeat any number of times).
FrontController forwards to a JSP file to compose the view.

The bit I'm getting mixed up on is how to draw step 3 where the ActionController may effectivey jump backwards a step over and over.

Here's what I have so far:



I know some of my boxes should have underlines in them... I just have't figured out how to do that in the software I used yet
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Scott Ambler's Introduction to the Diagrams of UML 2.0 has a couple examples of looping in Sequence Diagrams. Yours sounds like a loop-while kind of guard. See if that helps.
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brilliant thanks Would I be right to be getting the feeling that people don't always write UML following a completely strict set of rules? It's more about how well it conveys what it's diagramming?

I simplified my attempt by dropping mention of the factory (that was a little too close to an implementation detail for my liking) and emphasing the loop.

Does this make sense to anybody other than me?


[ August 27, 2007: Message edited by: Chris Corbyn ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chris Corbyn:
Would I be right to be getting the feeling that people don't always write UML following a completely strict set of rules? It's more about how well it conveys what it's diagramming?



Yes, absolutely.

It also depends on what UML is used for: http://www.martinfowler.com/bliki/UmlMode.html

A nice, more lightweight diagramming syntax for simpler diagrams can be found at http://agiledraw.org/ (it currently has some server problems, I have contacted the admin about it).

As an aside, are you sure what you have is a loop? It sounds more like a recursion to me (not sure how to show that in a sequence diagram, sorry...).
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is recursion. It's basically a filter chain, except there's no chain defined up-front. ActionDispatcher passes itself ('this') to ActionController, so if ActionController invokes its forwardToAction() method no loop has occurred, it's recursed back into the ActionDispatcher... I guess I could just change "loop" to "recursion". I have a feeling I've seen a little looped arrow to indicate recursion at a particular unit so I could probably stick that on the grouped box instead.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Back when I was doing a lot of diagramming I made liberal use of comments. The new fangled UML 2.0 has new decorations and shapes to indicate a lot of the things I just described in text. As long as the model doesn't have to compile and run (MDA) you only get "graded" on how well readers learn what they need to know.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic