Book a Demo

Author Topic: Sequence diagram, Instance Classifier, Message ?  (Read 20336 times)

Happy

  • EA User
  • **
  • Posts: 55
  • Karma: +0/-0
    • View Profile
Sequence diagram, Instance Classifier, Message ?
« on: December 15, 2010, 01:03:41 am »
Hi,

is this an issue or just expected behaviour?

What I've done:
  • Create ClassA with method foo() in a class diagram
  • Create ClassB with method foo() in a class diagram
  • Create ClassInstance:ClassA in a sequence diagram
  • Draw a Message from a gate to the Instance
  • Assign foo  to the Message (via Message Properties/Operations)
  • Reassign Instance Classifier of Instance from ClassA to ClassB (via Advanced->Instance Classifier)
Now I have a sequence diagram where there's a message foo drawn from gate to the ClassInstance:ClassB.

When I change the method name foo of ClassA now to something different (i.e. add), the sequence diagram is changed.

Now I have a sequence diagram where there's a message add drawn from gate to the ClassInstance:ClassB.

Why can I change the Instance Classifier of an Instance to a different class and the the messages to this Instance are still linked to the original Instance Classifier?.

Thx,
Happy



Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sequence diagram, Instance Classifier, Message
« Reply #1 on: December 15, 2010, 07:56:15 pm »
Happy,

The thing is that EA allows you to put any type of text as the message name. A link to an actual operation isn't mandatory.
So if you change the classifier of your lifeline, the link to the actual operation is broken, but the name still remains on the message.

Geert

Happy

  • EA User
  • **
  • Posts: 55
  • Karma: +0/-0
    • View Profile
Re: Sequence diagram, Instance Classifier, Message
« Reply #2 on: December 16, 2010, 12:13:43 am »
Geert,

I agree with what you say, but, when I change the operations name in the old classifier, theres still some linkage from the diagram, because the message text is updated again.

Of course changing the classifier of an instance in a sequence diagram doesn't happen very often, but it happens.

When doing some sort of roundtrip engineering theres the slight possibility that methods change or new methods arise from other sources out of the model or code.

I thought it to be a good idea, that if method names or parameter lists are changed no one has to care about all sequence diagrams, because they are updated automatically.

Also when theres already a method in a class and I want to add it to a sequence diagram, it is much easier to select it via the Operations dialog instead of retyping it ... .

So I see only two choices at the moment:
  • creating new sequences with new instances to new classifiers
  • not using the feature to use the classifiers operations at all in sequence diagrams, just using some free text into the message dialog
:(

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sequence diagram, Instance Classifier, Message
« Reply #3 on: December 16, 2010, 12:43:07 am »
Happy,

If this is the case, and the link is not broken between the message and the operation of the old classifier, then that is the bug.
If I change the classifier of my lifeline all links between messages, and operations defined on the old classifier should be broken (in order words, they should remove the tagged value from the message that contains the operations guid) Unless of course the operation is inherited by my new classifier as well.

Other then that I think this works fine in EA.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Sequence diagram, Instance Classifier, Message
« Reply #4 on: December 16, 2010, 08:23:26 am »
Just so you know.  EA creates a tagged value on the message that points to the operation.  Your results would indicate that it isn't removed when the classifier is changed.

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: Sequence diagram, Instance Classifier, Message ?
« Reply #5 on: November 01, 2023, 11:40:21 pm »
Eve,
That is correct. I opened another "Bug" on this as this causes renaming messages on existing diagrams, even in the case that they should should not be renamed.
https://sparxsystems.com/forums/smf/index.php/topic,48088.0.html


Sincerely,
Shimon