Book a Demo

Author Topic: Reference or Link between sequence diagrams  (Read 5248 times)

pinnacle_man

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Reference or Link between sequence diagrams
« on: September 25, 2002, 08:38:03 am »
Hi
Could someone please tell me, is it possible to link an entity from one sequence diagram to another entity in different sequence diagram?
e.g.  

Customer_Sequence Diagram

Admin      Customer_Screen       Address
   (create new address)   (when click on Address entity, it goes to Address                                                                                                              
                                        sequence diagram which is different diagram than
                                        Customer_Sequence Diagram)

Explanation:  
In Customer_Sequence Diagram, we have an actor, Admin, a boundary (form), Customer_Screen, and an object Address.  

We are using Address object in many other sequence diagram i.e. Company Address in Add New Company sequence diagram, Supplier Address in Add New Supplier sequence diagram.  Instance of we include Address object in all classes, if we create a sequence diagram separately for Address only (where we show how we creating an address object, what validation do we need when create a new address) and add a reference or link in all above classes, when click on reference or link, we should go to the Address Sequence diagram.

Any solution please??

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Reference or Link between sequence diagrams
« Reply #1 on: September 27, 2002, 08:12:35 am »
Hi, pinnacle_man.

When someone on the modeling team creates a first (provisional) version of sequence diagrams, the elements provided in the EA toolbox for sequences are the ones that are generally dragged into the diagram. Please note that these elements are created as "sequences", and not as classes.

So, as soon as you think that what you have diagrammed is not provisional, but that you have identified a good candidate for a class, it is very importat to change these "sequences" into classes (right-click on the element, and change object type).

I have noticed that these new classes (the ones just changed from "sequence" to "class") are not displayed immediately on the project tree; so I try to do as many changes as possible, and then close my project and open it again. (I don't know if this is the most efficient way of doing it, but it works.) My new classes are now displayed in my project tree, in the same package as my sequence diagram, so I proceed to move them to the appropriate package: as we have discussed elsewhere, it is a good practice to have all structural classes under a single package (as long as your project is not really very, very large). These are the same classes that will be used in the class (structural) diagrams.

I now insert instances (objects) of the appropriate classes (as would be the case of your Address), or the classes themselves (when my sequence involves classes, and not instances) into my sequences, and change the messages from the old sequences to these new objects: right-click on the message, and change message scope. You can delete the old sequence element after all your messages are pointing to the new instance or class (check the links tab, to make sure).

From then on, use only instances of the identified classes; that is, do not use a "sequence" element to represent an instance of an identified class.

I know it sounds complicated, but the hassle involved does not have to do with the tool, but with the general difficulties involved in identifying new classes. As your model evolves, you have to do many changes such as the one I have described. Of course, when it is possible to identify a new class early on, create the new class and use its instances instead of using sequence elements.

There are many advantages in using the same classes in sequences and in class (structural) diagrams. The most important is, of course, locality of change: any changes or additions to a class' attributes or operations are done in a single place. This also works very nicely with your Relationship Matrix.

I hope this is what you are looking for. If not, keep us posted.

Jaime Gonzalez
« Last Edit: September 27, 2002, 08:19:07 am by jaimeglz »

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Reference or Link between sequence diagrams
« Reply #2 on: September 27, 2002, 09:22:31 am »
I am wondering about the various object types.
I agree that sequence diagrams and collaboration diagrams should show interactions between instances. Changing the object type to class temporarily may be a clever way of creating classes instead of having to create them manually.

But what is the difference between "sequences" and "objects"? As far as I can tell, the only difference is that "sequences" only exist as a part of the diagram in which they appear, while "objects" can appear in multiple diagrams. I find it practical to use "sequences" because I avoid cluttering up my project browser with instances. "Sequences" can also have classifiers, thereby relating to the attributes and operations of their class.

And why isn't there an object type similar to "sequences" for use in collaboration diagrams? To me a sequence diagram is the same as a collaboration diagram; the first emphasizes the timing of the interaction, the second emphasizes communication paths.

I realize my questions are a bit vague, but I would like to start a discussion on the matter. Maybe it should take place in another thread.

Mikkel

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Reference or Link between sequence diagrams
« Reply #3 on: September 27, 2002, 09:57:27 am »
Hi Mikkel.

Sequence and collaboration diagrams are both in the same UML category: interaction diagrams. You are completely right in stating that the difference between them consists mainly in what they emphasize.

Please consider also that sequence diagrams can either depict interactions between classes or between objects (instances of those classes), as I have already pointed out in my posting on using states in sequence diagrams. Both forms are in complete conformance to UML rules, and it just depends on what you are trying to depict.

You are right also in questioning my changing sequences into classes as a general method: it is intended only as a trick or shortcut in the process of discovering classes.

Sequence elements in EA are great, as you point out, precisely because they do not clutter the project tree (and, because of this, you do not have to worry about maintaining them or deleting them in any other place but the diagram).

But consider the following: when I create a new message from one object to another in a sequence diagram, I get the chance of using the "New" button in the messages dialog box. This button enables me to create a new operation in the class to which the object belongs. I cannot do that if I am using a sequence element (unless, I suppose, if you have set a previously created class as the object's classifier; but this is a possiblity I have not tried yet). So, the fact that sequences are provisional has a price to it.

By the way, the "New" button works great both in the classes themselves or in their instances: if you create a new operation when sending a message to an object, the new operation is correctly created in the class.

I don't have an opinion on having sequence-like objects in collaboration diagrams, but lets see what others in our EA forum community have to say on this.

Jaime

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Reference or Link between sequence diagrams
« Reply #4 on: September 27, 2002, 10:01:31 am »
Hi Jaime,

the New button works the same way with sequences as with objects. When the object or sequence has a classifier, it is there. You can also add objects without classifiers to a diagram.

Mikkel

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Reference or Link between sequence diagrams
« Reply #5 on: September 28, 2002, 02:11:27 pm »
Sounds great, mbc.

What you are telling us is that the procedure I have outlined can be greatly simplified by simply right clicking in existing sequence elements and setting their appropriate classifier.

I'll still stick to using sequence diagrams in the process of discovering classes; but you have made my life somewhat easier now!

Lets try the trick of copying (Ctr-C) a sequence element from a sequence diagram into a collaboration diagram or a state chart. Maybe we can get away with not creating a new instances that clutters the project tree!

Jaime

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Reference or Link between sequence diagrams
« Reply #6 on: September 30, 2002, 01:24:07 am »
Hi Jaime,

Tried out you suggestion, but did it by changing the object type of Objects into Sequences in a collaboration diagram. There are a few side effects. I can't get completely rid of the lifelines, can't resize them like objects, and the relationship arrows has to be positioned manually to look nice.

By the way, I requested a feature from Sparks, which seems relevant to our discussion, so I'll include it here:

My request:
---
Conversion between sequence and collaboration diagrams.
Because sequence and collaboration diagrams show the same thing, it is possible to do an automatic conversion between the two. Thereby the model could give a clearer view with almost no extra
effort.
---

Sparks' reply:
---
Hello Mikkel,

We  do  plan to do this - but I think it will be next year before its available.
We  are  currently working on the last stages of the next release of EA (3.50) - after  that  the  main  concern  is to get Corba/IDL/COM support in EA - which I think will take a bit of work.

I regret I cant offer something quicker - but it will be done eventually,

Best regards,
Geoffrey Sparks
---

... and that's good enough for me. I am already impressed with the amount of features they have been able to include in their product.

Mikkel