Author Topic: If I change an Interface... How to update classes?  (Read 1617 times)

Miguel Gonzalez

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
If I change an Interface... How to update classes?
« on: December 02, 2010, 10:57:54 am »
Hello,

I have a class that is implements an Interface. If I change the Interface's signature... Is there an automatic way of updating the class without having to remove the realization association and creating it again?

On a simple example of one Interface and one Class is easy but when talking of many, the thing gets complicated.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11229
  • Karma: +413/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: If I change an Interface... How to update clas
« Reply #1 on: December 02, 2010, 09:34:24 pm »
Ctrl+O

Geert

philchudley

  • EA User
  • **
  • Posts: 667
  • Karma: +16/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: If I change an Interface... How to update clas
« Reply #2 on: December 03, 2010, 03:42:49 am »
Shouldn't that be Ctrl+Shift+O ?

Since Ctrl + O opens a project

Ctrl+Shift+O opens the Overiddes / Implements dialog, but it is my understanding that updates to interfaces have to be updated on each class separately using this technique

To "bubble" a change down to ALL classes, well first you have to get all the classes that implement an interface (Add Related Elements), then apply the changes. This is same old complaint, that you cannot apply changes to a selection of elements  :(

Unless there is a much quicker and more automated method

Cheers

Phil
follow me on Twitter

@SparxEAGuru

Miguel Gonzalez

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: If I change an Interface... How to update clas
« Reply #3 on: December 03, 2010, 09:23:35 am »
I am with you Phil, not being able to apply changes to an entire selection of elements is far from ideal.

Also, Ctrl+Shift+O allows you to update new created methods in the interface but it does not allows you to make updates if you have deleted a method from the interface.

If you have changed the interface in a way that its signature offers less functionality, you have to delete those implemented methods manually from all classes that previously implemented.

Perhaps the "Overiddes / Implements" dialog should show you those methods that not longer exist on the interface and allow you to tick them to decide which one to leave and which one to remove from classes that previously implemented them.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11229
  • Karma: +413/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: If I change an Interface... How to update clas
« Reply #4 on: December 03, 2010, 03:25:04 pm »
Quote
Shouldn't that be Ctrl+Shift+O ?

Since Ctrl + O opens a project
Oops :-[ of course it is.

We had a discussion here recently about he very same subject a while ago. It might be useful to look that up and add to it.

Geert

Miguel Gonzalez

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: If I change an Interface... How to update clas
« Reply #5 on: December 05, 2010, 04:50:06 am »
I think it should be done. When using EA for software design, you need to do and re-do, and change many things many times. Having the "Overiddes / Implements" dialog showing you methods to implement or to not longer implement will be of great help.

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: If I change an Interface... How to update clas
« Reply #6 on: December 06, 2010, 09:07:10 pm »
 ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
"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.