Book a Demo

Author Topic: Why are required interfaces available in combobox for sequence diagram?  (Read 5179 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
I have a class with a port, typed by an interface. When I draw a message to this class in a sequence diagram, I see that the class has inherited all the functions. How did that happen?

As an example, take a look at the UML standard 2.5 https://www.omg.org/spec/UML/2.5.1/PDF. See figure 11.11 Port Notation. Two ports are typed by the interface IPowerTrain. In a sequence diagram, if I draw a message from Engine to Wheel, then I see all the messages for the interface IPowerTrain as "inherited messages". This is wrong.

I have tried using the "isConjugate" setting to true, but no success. Only removing the interface from the port type does the job. However, then I have two ports, one with an interface and the other without, and that is strange too.
« Last Edit: January 24, 2020, 01:38:22 am by mse »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Why are required interfaces available in combobox for sequence diagram?
« Reply #1 on: January 24, 2020, 04:28:23 am »
You get different life lines for each port (which of course has inherted the operations of the ifaces it realizes). This way you can show more details like which port of a component handles which message.

q.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Why are required interfaces available in combobox for sequence diagram?
« Reply #2 on: January 24, 2020, 09:00:58 pm »
I inserted a lifeline for the port that is REQUIRING the service, and when I draw a message to this port, I still get the list of operations. In other words, both lifelines are showing ALL operations of the interface when I go to select a message even though one requires and the other provides.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Why are required interfaces available in combobox for sequence diagram?
« Reply #3 on: January 24, 2020, 09:33:16 pm »
I see. That would be strange and probably be an error to be reported. Sorry, no time to verify that currently...

q.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Why are required interfaces available in combobox for sequence diagram?
« Reply #4 on: January 24, 2020, 10:08:08 pm »
If anyone is interested in reproducing this, it is easy:

  • Create a composite structure diagram
  • Add a class "ClassA" and a "ClassB", each one with a port "p"
  • Create an interface "I" and type the ports "p" on each class with the Interface "I"
  • Add an Operation to Interface "I" called "op1"
  • Create a sequence diagram
  • Add two lifelines, one for ClassA and one for ClassB
  • Draw a message from ClassA to ClassB, then on the properties of the message, look at the dropdown list for Messages, you will see
  • Operation op1()
  • Draw a message from ClassB to ClassA, then on the properties of the message, look at the dropdown list for Messages, you will see again the OPeration op1() available

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Why are required interfaces available in combobox for sequence diagram?
« Reply #5 on: January 24, 2020, 10:22:49 pm »
For now, the best I can do, is to continue having both ports typed by the same interface, since they have to be compatible. However, when selecting Messages in the list, I will remove the checkmark on "show inherited methods". This will then show me only the methods that the receiving class supports.