• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Showing iteration on sequence diagram

 
Frank Silbermann
Ranch Hand
Posts: 1408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On a sequence diagram, I can put a guard on an arrow to indicate conditional or iterative execution. But what if the condition or iteration step requires a sequence of actions between the user and the system? How do I show this in a sequence diagram?

For example, suppose the user enters data to a form, and the front servlet checks it. If the data is invalid, the servlet forwards to the original JSP with errors highlighted for correction, and the user re-enters the data. This subsequence can happen repeatedly. If the data is good, the servlet processes the data and forwards to the next JSP. How do I show this on my sequence diagram?

Or should I just show the happy path, and add a note describing the extra steps that would have to be inserted in case the data is bad?
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,

Maybe you should look at the interaction frames within the sequence diagram?

About guards in sequence diagrams, 'UML Distilled' says: "UML 1 used interaction markers and guards. An interactive marker is a * added to the message name. You can add some text in square brackets to indicate the basis of the iteration. Guards are a conditional expression placed in square brackets and indicate that the message is sent only if the guard is true. While these notations have been dropped from the sequence diagrams in UML 2, they are still legal on communications diagrams."

Regards,
Dan
 
Frank Silbermann
Ranch Hand
Posts: 1408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dan Drillich:
Frank,

Maybe you should look at the interaction frames within the sequence diagram?

'UML Distilled' says: "UML 1 used interaction markers and guards. An interactive marker is a * added to the message name. You can add some text in square brackets to indicate the basis of the iteration. Guards are a conditional expression placed in square brackets and indicate that the message is sent only if the guard is true. While these notations have been dropped from the sequence diagrams in UML 2, they are still legal on communications diagrams."
Dan


I never heard of Interaction Frames, but I just did a web search and they look like just what I need. I hope my tool (Jude) is UML2 compliant.
[ August 12, 2004: Message edited by: Frank Silbermann ]
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,

Interaction frames are indeed new to UML 2.

Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic