Author Topic: Class Diagram: Show inherited operations  (Read 2604 times)

Dieter Vekeman

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Class Diagram: Show inherited operations
« on: February 05, 2011, 06:29:28 am »
In the UML Class Diagram
how can I show the inherited operations on a class (realize relationship) from the interface so that they are automatically updated if the interface is updated?

A diagram has an interface and an implementing class (realize).
    [*]When making the realize relationship, the Overrides & Implementation dialog shows. When the checkbox is selected, the operation is correctly shown on the class. However when the interface is updated afterwards, the class isn't updated along. The only option I've found so far is removing and recreating the relation. If there are multiple classes this is quite a burdon (also the old method needs to be removed on the class). This seems like a bug to me (or is there a reason for this behaviour)?
    [*] Second option I've found was the feature visibility. However that only works for generalization relationships. In my case it works fine if I use it on an interface extending another interface or a class extending another class. But it does not work on a class implementing an interface. However the documentation says When Enterprise Architect displays inherited features, it creates a merged list from all generalized parents and from all realized interfaces

    Hence my question(s):
      [*] Is there a way (setting, ...) to make the Override and implementation work properly (automatically update the realization class)
      [*] Is there a way (setting, ...) to make class show inherited operations?

      I'm using version EA 8.8.858

      Update the only workaround I found was to
        [*] Create the interface as an abstract class with interface stereotype
        [*] Link the class with the 'interface' using generalization relationship and hide the connector
        [*] Link the class (again) with the 'interface' using the realize relationship
        [*] use the feature visibility on the class to show the operations
        It looks the same on the diagram however there are some disadvantages such as
          [*] the embedded interface view cannot be used because it's not a real interface
          [*] when working with generated code (either imported or code that you want to export) it is not correct: abstract class vs interface
          [*] ...
          « Last Edit: February 05, 2011, 06:56:32 am by dvekeman »

          Paolo F Cantoni

          • EA Guru
          • *****
          • Posts: 7627
          • Karma: +194/-121
          • Inconsistently correct systems DON'T EXIST!
            • View Profile
          Re: Class Diagram: Show inherited operations
          « Reply #1 on: February 06, 2011, 08:00:08 pm »
          Hi Deiter,

          You've raised the perennial question...

          One problem is that the usual argument for NOT allowing Realization to behave similarly to Generalization is that the two are definitely not the same.  Generalization is about providing access to previously defined features and Realization is about creating a client instance of a supplier specification.

          What is MISSED in this argument is that like "version control", you need to separate the generated code and the effect within the modelling paradigm.  That is, version control for code and version control for models is NOT the same (similar, but definitely NOT the same).

          So it is with Generalization vs Realization, when the code executes, the two are NOT the same; but in the modelling sense they are FAR MORE alike than different.

          I see allowing Generalization to automatically update the "effective" view in the client and NOT allowing Realization to do the same as (to me) inconsistent.

          If you agree, then the easy way out is to take a Generalization link, stereotype it Realization and use a shape script to render the Generalization as a Realization.   I've often done that with no (or few) "ill effects" - certainly less than those brought about by forgetting to manually regenerate the Realization.

          « Last Edit: February 06, 2011, 08:05:36 pm by PaoloFCantoni »
          Inconsistently correct systems DON'T EXIST!
          ... Therefore, aim for consistency; in the expectation of achieving correctness....
          Helsinki Principle Rules!

          Geert Bellekens

          • EA Guru
          • *****
          • Posts: 10813
          • Karma: +381/-33
          • Make EA work for YOU!
            • View Profile
            • Enterprise Architect Consultant and Value Added Reseller
          Re: Class Diagram: Show inherited operations
          « Reply #2 on: February 07, 2011, 06:51:00 pm »
          Oh no, that discussion again :(
          Must be at least the 5th time this has been discussed here.



          • EA Practitioner
          • ***
          • Posts: 1406
          • Karma: +1/-2
          • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
            • View Profile
          Re: Class Diagram: Show inherited operations
          « Reply #3 on: February 13, 2011, 09:19:36 pm »
          I never said a word!  ;)

          Just passing through Adelaide again, back to the outback again later this week.  FWIW I got my black cert back in Nov. so I can now blow things up too!  (Well OK, blow holes up too).  56 years young and never had so much fun. Paolo, I "nearly" made it to Perth last month, 1600km NE. 'Twas quite warmish!
          "It is not so expressed, but what of that?
          'Twere good you do so much for charity."

          Oh I forgot, we aren't doing him are we.