Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2012-03-21T18:13:40Z by M2D7_Steve_Lilleyman
SystemAdmin
SystemAdmin
1305 Posts
ACCEPTED ANSWER

Pinned topic Port inheritance issue

‏2011-09-16T13:11:08Z |
Hi all,

I'm facing a problem about class generalization in Rhapsody 7.5.3.1

I try to explain the situation:

Class A with PortA showing InterfaceA as required contract. InterfaceA has got an operation() method.

I draw a sequence diagram showing a client calling operation() on A.

Now I define a new class B with a generalization relation to A. B inheriths PortA from A and defines a new PortB with another interface.

When in a sequence diagram I try to call a method on B, Rhapsody lets me select operation() (in the feature window of the message) but an error popup occurs:
Formal message "operation" now define in "B".

It seems that is not allowed to call a method exposed by an inherited interface. It is correct? There is something I missed?

Thanks for the precious help.

Valerio Del Grande
Updated on 2012-03-21T18:13:40Z at 2012-03-21T18:13:40Z by M2D7_Steve_Lilleyman
  • SystemAdmin
    SystemAdmin
    1305 Posts
    ACCEPTED ANSWER

    Re: Port inheritance issue

    ‏2011-09-18T10:23:51Z  in response to SystemAdmin
    Hi,

    I don't seem to follow you.
    Since class A only has portA which has a required interface to interface 'I', and interface 'I' has operation 'foo', you can't call directly on class 'A' operation 'foo', since class 'A' doesn't inherit from the interface (it just has an association to it). The only way to call 'foo' is via the port (i.e. OUT_PORT(portA)->foo() ). The same for class 'B'.
    Therefore, i don't understand how you were able to select the opeation in the Sequence Diagram. It seems that you have done something more than what you've described.
  • M2D7_Steve_Lilleyman
    2 Posts
    ACCEPTED ANSWER

    Re: Port inheritance issue

    ‏2012-03-21T18:13:40Z  in response to SystemAdmin
    I have the same problem in Rhapsody 7.5.2.1

    I have defined a port with a contract on an actor A which represents a generic role.

    I have created another more specialised actor B which inherits from the general actor A. I have done this to enable multiple inheritance of services from different actors representing different service providers/requirers.

    I can see the inherited ports in the specialised actor B's Features dialog by ticking the 'Show Inherited' checkbox on the Ports tab.

    When I try to realise a message for the specialized actor B on a sequence diagram, I can see the event receptions inherited from the port contract in actor A, in the 'Select Message' option in the right-click menu. However, when I select one of the inherited reception, I get the error message:

    Formal message "<message name>" not declare in ""

    This is I believe the exact same issue. It means I cannot inherit any port contracts, which makes reuse of the service definitions impossible.