Book a Demo

Author Topic: How to "refresh" a realized interface  (Read 7578 times)

Mark G

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
How to "refresh" a realized interface
« on: July 27, 2009, 09:49:42 pm »
I'm sure this must be pretty simple to do...

If I have a defined interface which I then realize on a class I am able to select the interface operations that I wish to realize.

If I then change the interface (e.g. add a new operation or change the signature of an existing one) then how do I "refresh" the class that realizes the interface to show the changes?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "refresh" a realized interface
« Reply #1 on: July 27, 2009, 11:03:42 pm »
select the class and press Ctrl-Shift-O

Mark G

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: How to "refresh" a realized interface
« Reply #2 on: July 27, 2009, 11:17:40 pm »
Thanks for the reply.

This works for new operations but does not update any existing operations. Specifically:

  • If I have deleted an operation in the revised interface then it does not get removed in the class
  • If I have modified an operation in the revised interface then I get another operation added
Any more ideas?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "refresh" a realized interface
« Reply #3 on: July 27, 2009, 11:24:05 pm »
I don't think there is a solution for those two situations.
I don't believe EA keeps a link between the operations on the interface and the operations on the class.
This means that it cannot know wether an operation was previously defined on an interface realized by this class.
This is probably why it creates a new operation when the signature has changed, and it does nothing when an operation is deleted.

There could possibly be a solution if you create your own addin and hook into a "operation changed" event, but that's a long shot.

Geert

Mark G

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: How to "refresh" a realized interface
« Reply #4 on: July 27, 2009, 11:31:14 pm »
Thanks for you help.

I agree that EA appears to keep a "snapshot" of operations taken at the time of realization.

I think that this feature really *should* be included in the product!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to "refresh" a realized interface
« Reply #5 on: July 28, 2009, 04:16:59 am »
Some time ago one of the Sparxians posted a solid explanation of how this works (or does not). I am sorry but I don't remember which keywords will be sure to find the post.

There are trade-offs either way. Just updating the interface and calling classes can quickly involve some pretty in-depth refactoring. Sparx had to weigh carefully whether they wanted to invoke this or not. There were other related issues as well, and IIFC the post gave at least one excellent example. Sparx chose to let (force) users to handle the updates themselves (manually).

So this is not simply a 'missing' feature, or a case of Sparx stopping short of the 'whole' job. Still, the lack of any options or functionality in this area is a bit disconcerting...
No, you can't have it!

Mark G

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: How to "refresh" a realized interface
« Reply #6 on: October 02, 2009, 11:16:22 pm »
I find this lacking feature very frustrating!

I work on agile projects and it simply just isn't possible or advisable to know an entire interface up-front. Many people do not practice large "up front design" these days therefore interfaces evolve iteratively as solutions are elaborated over time.

On a daily basis I have to do a workaround to refresh realizations which is a real pain in the ***. I use EA a lot and this is my only major gripe with this whole product.

I hope someone at Sparx reads this and adds this feature!!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "refresh" a realized interface
« Reply #7 on: October 02, 2009, 11:24:25 pm »
Mark,

If you really need something like that you should send Sparx a formal feature request.
Use the link on the bottom of the page.
We usually include the link to the forum topic so the Sparxians can follow the discussion and see how much support there might be for a specific feature.

In the meantime I think it should be doable to create a small addin that allows you to synchronise the classes with the interfaces.
Must be two or three days work I think, but reading your response it looks like this could be worth it.  ;)

Geert

Mark G

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: How to "refresh" a realized interface
« Reply #8 on: October 02, 2009, 11:29:06 pm »
Thanks for the tip - I've just sent the request...

BTW, where can I find out about add-ins?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "refresh" a realized interface
« Reply #9 on: October 02, 2009, 11:35:32 pm »
There's a whole section about it in the help file "SDK for Enterprise Architect" and there are some examples available from the website.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to "refresh" a realized interface
« Reply #10 on: February 12, 2015, 06:46:22 pm »
For those still struggling with this problem, I created an EA-Matic script that keeps those override/realized operations in sync with the parent operation: Automatically synchronize overrides with EA-Matic

Geert