• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

repeated group of operations in sequence diagrams

 
guy katz
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi;
i have a group of operations that execute several times, as a whole, in the life time of a sequence diagram. this gourp of operations are not one right after the other but rather scattered in several places in the diagram.
is there a way to save space in the sequence diagram and instead of duplicating groups of calls use only one group of calls?
thanks.
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I'm dealing with the same issue. The only thing that comes to mind at the moment is to break out the repetitive code into its own separate use case and then include it in the main use cases. I think that will work with some of the larger chunks of repetitive code but for smaller ones I am not sure that's a great solution.
Darryl
 
guy katz
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
darryl wrote:
"The only thing that comes to mind at the moment is to break out the repetitive code into its own separate use case and then include it in the main use cases"
how will that help?
can i reference another sequence diagram from another to encapsulate the group of operations?
what is the UML way to acheve it?
thanks
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Shoot! I wish I had my UML book here that I could research to give you an informed decision but I don't. Here's my take on it though. If, when developing sequence diagrams, you find yourself coming across reasonably large or complex sequences that are repeated one or more times in different diagrams or in different (and disjoint) parts of the same diagram, factor the repretitive sequences into their own separate sequence diagrams. This, in my mind, is the same as introducing a new use case into your model, creating a new sequence diagram for it. Other use cases can then include it when appropriate or
it can itself be used to extend other use cases.
Once you have done this you can then treat the new use case as a classifier in the original diagram sending and receiving messages to it as appropriate -- much in the same way as you can send messages back and forth between actors and classes, classes and interfaces, interfaces and components, components and actors, etc. -- or more generally, between classifier and classifier.
You'll have to do something like this in any situation where you are asked to draw sequence diagrams for two or more use cases and at least one of the use cases extend or are included by other use cases.
I hope I am not out to lunch on this one!
Cheers,
Darryl
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic