In Enterprise Architect I modified an interface, how to update the realizing classes

enterprise-architectuml

I've created an interface in a class model. This interface has two methods, A and B and method A takes an argument (a) and method B does not take an argument (yet).
Additionally I've created a class that implements this interface, overriding both methods.

After a discussing the model method B now should also take a parameter (b), so I modified the interface to reflect this change. However the class realizing this interface is not updated automatically. For one class it's possible to add the method by re-creating the link between the interface, specify the which method should be implemented and deleting this link again. Then the OLD method signature has to be removed as well.
This is a lot of work if there is more then one class implementing the modified interface, not to mention error-prone.

Does anybody know how to make an entire class model update this type of dependency?

Best Answer

I have also searched for the answer to this question, but apart from your post I didn't find anything. I posted a question on the EA Forum.

If it is for diagram purposes only, there 1 possible workaround (but a bit nasty):

  • Add your interface to the diagram as an (abstract) class with the <<interface>> stereotype
  • Add your class to the diagram as a class with the <<implementingClass>> stereotype
  • Add a generalization relationship from the class to the interface, don't select any checkbox in the Overrides & Updates
  • Hide the connector
  • Add a realization relationship from the class to the interface
  • Right-click on the class > Feature Visibility > check the Show Operations checkbox

As a result

  • The abstract class with look like an interface on the diagram
  • The implementing class will show the inherited operations
  • When adding operations to the interface, the class will be updated
  • When modifying operations on the interface, the class will be updated

The only problem is that during code generation an abstract class is generated instead of an interface.

Related Question