Book a Demo

Author Topic: Linking notes to elements not on same diagram  (Read 5255 times)

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Linking notes to elements not on same diagram
« on: August 13, 2002, 03:39:46 am »
I would like to add a note containing a use case scenario to a sequence diagram. I know how to do this, if the use case itself were on the diagram, but that is not what I want. Can I somehow link a note to an element not on the diagram? Or is there another way to accomplish the same thing?

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Linking notes to elements not on same diagram
« Reply #1 on: August 13, 2002, 08:37:25 am »
Hi, mbc.

I have been coping with the same problem for some time, and this is the best I have been able to come up with so far:

A scenario is, strictly speaking, an instance of a use case (see the definition of scenario in Rumbaugh, et al.: The Unified Modeling Language Reference Manual, Addison-Wesley, 1999, p. 416). For those not familiar with this terminology: an instance of a use case is a particular execution of the use case, just like you and I are particular instances of the "user" class, playing a particular role in instances of a software_development_processes.

So, the way I am handling the relationship between a scenario and its respective interaction diagram (or, when appropriate, state chart diagram) is by dragging the interaction diagram from the Workspace tree into the use case diagram, as suggested by Rafael Gonzalez in his posting in the " How to link diagrams to use cases?" thread; then, I link the use case to the interaction diagram icon with an "instantiation" relationship. This is not very orthodox, and a rigoristic methdologist will very probably give me dunce's ears and send me to a corner for this, because the "diagram" symbol is not UML. But it works, and I think I can make a pretty good argument that it is logically correct.

Works great for navigation: just double-click on the interaction diagram icon, and you navigate right into the interaction (or state chart); and viceversa: drag and drop the use case diagram into the interaction diagram, and you can navigate back to the use case diagram. It also works great in the relationship matrix, where you can obtain a panoramic view of which use cases have been instantiated.

In your particular case, I don't think it would be correct to link a note element to a use case or to an interaction diagram with an  instantiation  association: notes are not UML classifiers (they are just a place for free text). I would suggest something like copying the text in your note into the description of a new use case, and stereotype this new use case to «scenario» (which is totally valid even if «scenario» is not listed in the stereotype drop-down list); then join it to the original use case with an instance association. The instance of the use case (the new use case) should replace the note. This would be strict UML, but you could also proceed in the unorthodox way I have suggested.

Best wishes (and let's see what the rest of our enthusiastic community of EA users has to say).


Jaime

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Linking notes to elements not on same diagram
« Reply #2 on: August 14, 2002, 07:38:12 am »
Jaime, thank you for the very thorough answer. However, it seems that I may have been a bit unclear in my formulation of the question. By "scenario" I mean the text descriptions that one enters in the Use Case Properties dialog, on the "Scenarios" tab. I would like to display this text in a note, without having to copy it manually every time it is changed.
I know how to do this if both the use case and the note are on the same diagram (make a note link from the note to the use case, select the link, then select "Link note to element feature" in the context menu). But I want the note to be on a sequence diagram, so that the text describing the sequence is visible. Therefore I cannot make a note link to the use case, because there doesn't seem to be such a thing as a "cross-diagram note link".

Mikkel

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Linking notes to elements not on same diagram
« Reply #3 on: August 15, 2002, 02:16:27 am »
I want to let those who may be interested know that I have found an answer to my own question.
It is so simple, I am a bit embarrassed I didn't think of it before.
Step by step:
1. Insert an empty note on the sequence diagram.
2. Drag the Use Case from the project browser onto the sequence diagram
3. Make a note link from the note to the use case
4. Select the link and choose "Link this Note to an Element feature" from the context menu.
5. Find the scenario to be displayed in the note, and clik OK
6. Delete the Use Case from the diagram. The link is still kept intact and working, so that any changes I make in the scenario text is reflected in the note.

kelly_sumrall

  • EA User
  • **
  • Posts: 73
  • Karma: +0/-0
    • View Profile
Re: Linking notes to elements not on same diagram
« Reply #4 on: August 16, 2002, 05:47:53 am »
Nifty trick.  I now know how I'm going to add the margin sequence to my sequence diagrams.  You just saved me hours.

Thanks
Kelly Sumrall

Even though curiosity killed the cat, it still had eight lives left.