Book a Demo

Author Topic: UML question:  Linking sequence diagrams  (Read 3899 times)

TrtnJohn

  • EA User
  • **
  • Posts: 176
  • Karma: +0/-0
    • View Profile
UML question:  Linking sequence diagrams
« on: July 07, 2004, 12:35:56 pm »
I'm new to UML and sequence diagrams and I would like to know what is the best way to show common or shared functionality without having to redraw it over and over again within each sequence diagram that uses it.  Also, I have the same issue if a diagram gets too big and I would like to break into parts.

I'd use packages for this with most other diagrams.  But I am not sure if this is right way to do it for sequence diagrams.  

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: UML question:  Linking sequence diagrams
« Reply #1 on: July 09, 2004, 02:54:52 am »
Well,

its simple and not so simple :D

How would you implement functionallity wich is used over and over again without wanting to reimplemetn it?

You factor it out into its own class and instanciate it and call its methods when needed.

That was the simple analogy, in a sequence diagram thats not that easy.

Anyway, if you have to big and to complex SQ diagrams, you need to invent a "black magic box" wich tries to abstract away those parts you like to reuse.

Likely it will be indeed a class/object resulting from that which you can implement later.

Another way is to define layers and create interface classes for those layers.

So you could e.g. model the users interaction with the GUI layer leaving out the complicate stuff happening behind the "GUI Interface class".

Then you make a "control class" which interacts with the DB, your business objects and other actors to achive their goal. In that case the most left side entity is not an Actor in the diagram but that control class.

Now you need to flesh out the middle: "GUI Interface" <-> "middle part" <-> "control class".

Probbaly it is easyer to start with the last step above :D

Hope that helps,
   angel'o'sphere

whyteg

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • Mr Evaluator
    • View Profile
Re: UML question:  Linking sequence diagrams
« Reply #2 on: July 09, 2004, 06:09:55 am »
The introduction of UML 2.0 provides a new artefact called a fragment. If you have the latest version of EA then these are supported.

The fragment allows common behaviour to be encapsulated into it such that it can be re-used in other sequence diagrams. It was also introduced to reduce the size of large sequence diagrams by providing a mechanism to hierarchically decompose a sequence of events. Thus, it is a good idea to think of a fragment as a child sequence within a sequence diagram.

Hope this helps.

TrtnJohn

  • EA User
  • **
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: UML question:  Linking sequence diagrams
« Reply #3 on: July 09, 2004, 09:48:09 am »
Thanks guys.  I think a combination of both of your solutions is perfect.  In fact, after playing around a while, I found out that you can simply drag a sequence diagram from the explorer window into another sequence diagram and it will automatically create a fragement of type ref.  This is nice because from the diagram you can just double click the fragment to see the linked sequence diagram.  Throw in a few diagram gates to the fragment for each message that travels between diagrams and I am done.  EA constantly amazes me on how simple things are.  (Once you find em).   There must still be 1000s of great things I still don't know about the this program!!