Book a Demo

Author Topic: interface changes not propagaing to class  (Read 4335 times)

jjyoung

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
interface changes not propagaing to class
« on: December 21, 2013, 02:12:16 am »
If I create an interface, then specify a realization of it, then I find that if I modify the interface I can't get the changes to propagate to the realization.  The image attach shows an interface where I changed the stereotypes of some of the methods to <<property get>> and property set.  In addition I added the getId() and setId() abstract methods.

In order to get the getId() and setId() methods to be added to PersonAb I needed to delete the realization link and then add it again.  But it had no effect on the methods that I stereotyped as <<property set>> and <<property get>>

Two questions:
1. Is there a way to get new interface methods to be propagated to the classes that realize the interface without deleting an re-adding the realization relationship?
2. Is there a way to get changes to the methods in the interface to propogate?


Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: interface changes not propagaing to class
« Reply #1 on: December 21, 2013, 09:43:51 pm »
Hello,

I don't know if there is a hidden trick to get the work done.

I would see the following possibilities:
  • Feature Request to SPARX
  • It might be part of the next major release
  • Write an Addin (may be there is already an Addin in the community)

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: interface changes not propagaing to class
« Reply #2 on: December 22, 2013, 10:18:58 am »
No there is no automated method

However the is a way to get changes into a class without deleting and re-creating the realization link

[highlight]Select the class and the press the key combination Ctrl + Shift + O which brings up the overrides / implementations dialog[/highlight]

Any methods in the interface which are not in the class (including those which have the same name but different signatures) are listed and can be added to the class

This method is not entirely what you are requesting, but is quicker than deleting and re-creating the realization

Cheers

Phil
Models are great!
Correct models are even greater!

jjyoung

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: interface changes not propagaing to class
« Reply #3 on: December 23, 2013, 01:39:40 am »
Thank you both for your suggestions.  They do solve part of the issue but don't seem to fully address the issues.  I did a lot of investigating on the fotums, manual and through internet searches but wasn't able to come up with a solution.

It has always seemed odd to me that one of the primary design goals of OO (i.e. design to interfaces) is so poorly implemented by EA, amd this comes from a long term EA owner and supporter.  The lack of active relationships between interfaces and their realizations greatly reduces the usage of them while doing incremental design.  If you don't get your interfaces exactly right during initial design, or you need to refactor, or change them due to requirements changes then there can be a lot of changes needed to the realizing classes.

Il‘ll be submitting an enhamcement request for this.   Also, while I don't really wnat to take the time, I‘ll start looking at the possibility of creating an add on to do it.

jjyoung

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: interface changes not propagaing to class
« Reply #4 on: December 23, 2013, 03:12:08 am »
Another thought I had was to have a way to validate that a class fully realizes an interfaces specified methods.  However, I haven't figured out a way to do that either.  I've tried Model Validation under the Project menu and included bother the interface and the realizing class (minus 2 minus) but it's not detecting any errors.  Suggestions?
« Last Edit: December 23, 2013, 03:12:39 am by jjyoung »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: interface changes not propagaing to class
« Reply #5 on: December 23, 2013, 06:16:58 pm »
I don't like the idea of automatically propagating interface changes to the classes that realize them, but I do like the idea of the validation (such as a compiler would).

Such a validation could be easily done in an add-in, but I believe it should be part of the standard package.

Geert

jjyoung

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: interface changes not propagaing to class
« Reply #6 on: January 02, 2014, 04:15:48 am »
Yes, I can see your concern about auto-propagation of interface changes in a model that's fairly well developed, since changing interfaces is not usually a good idea at this point.  However, in the beginning stages of domain design there is a lot of refactoring and abstraction of related objects taking place, which can make the interface specifications fairly  fluid.  Also, there doesn't seem to be a way to abstract an interface from an already created class. This seems to be a real limitation.