Book a Demo

Author Topic: method rename not in generated code  (Read 5901 times)

tecman

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
method rename not in generated code
« on: December 02, 2011, 12:34:42 am »
I've noticed two behaviors related to changing method names that don't seem right to me.
1) If I rename a method on a class diagram, I'd expect EA to rename the method in the code.  However, when I regenerate code with “always sync w/existing file”, EA doesn't change the method name in code, but adds another method with the new name.
Is there a way to get it to rename the code method without overwriting the entire code file?

2) If I rename a method in code, then sync with the model, EA will correctly rename the method on the class diagram, but a sequence diagram will still have the old (now nonexistent) method name.  I would expect all diagrams would be updated with the new name.

thanks in advance!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: method rename not in generated code
« Reply #1 on: December 02, 2011, 08:27:24 am »
There is an option to allow manual selection when an operation has been renamed on generation. See Tools | Options | Source Code Engineering | On forward synch, prompt to delete code features not in model.

If you rename a method in code and reverse engineer it, EA is not renaming the operation in the model. According to the options on the same page it is deleting the old operation (which doesn't effect the sequence diagrams) and creating a new one.

tecman

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: method rename not in generated code
« Reply #2 on: December 06, 2011, 11:09:15 am »
I would expect that deleting a method should at least popup a prompt that says "you've deleted method xyz, do you want to remove it from  sequence diagram abc?".  Currently, it just does nothing, so I have to always remember to check my sequence diagrams if I change the method name in code.

If I change the method name on the class diagram, EA DOES change the name on the sequence diagrams, which seems to be the more correct behavior.