Book a Demo

Author Topic: Code generation include deleted associations  (Read 3359 times)

johnm9

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Code generation include deleted associations
« on: June 19, 2008, 08:08:53 pm »
Is that a bug or a known inability of EA?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Code generation include deleted associations
« Reply #1 on: June 20, 2008, 09:02:48 am »
Go to "Tools > Options > Links" and tick the option "Prompt on connector deletes". Then select a connector and press Delete. A dialog will pop up asking you whether the Delete key should delete or hide connectors. I suspect you have it set to "Hide the connector" and you haven't been deleting connectors but hiding them. Hope that helps, but shout if not.
« Last Edit: June 20, 2008, 09:54:51 am by KP »
The Sparx Team
[email protected]

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Code generation include deleted associations
« Reply #2 on: June 20, 2008, 09:47:32 am »
This wasn't clearly documented in the Help. It is now.
Best Regards, Roy

johnm9

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Code generation include deleted associations
« Reply #3 on: June 20, 2008, 11:39:31 am »
I've checked the Tools menu, the "prompt for connector delete" is on.
I think the connector has really been deleted from the model.

The point is, I have the connector and generate the code. Then, i delete the connector and regenerate without deleting the content of the previously generated file.

So, do you actually expect people to firstly deleted the source code everytime before regeneration of code?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code generation include deleted associations
« Reply #4 on: June 20, 2008, 11:48:45 am »
The point was that the connector may have been hidden on the diagram, not actually deleted.  Try checking the Links tab of the properties dialog to see if it is still actually there.

Also, have a look at Tools | Options | Source Code engineering | On forward synch, prompt to delete code features not in model.

Without this option EA will never delete attributes or operations from your code.

johnm9

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Code generation include deleted associations
« Reply #5 on: June 20, 2008, 12:20:50 pm »
I'm pretty sure that the association has been deleted completely from the model. I have checked out the link dialog of the class and there was no more linkage in the list. I retried the code generation (C) and the generated code still carries the pointer to that type.

To further prove the association has been deleted from the model, I have cleaned all content from the source file and retrigger the code generation. The newly generated code is now carrying no pointer to that type.

So, it seems that for those deleted model elements, the source file must be cleaned and regenerated in order to reflect the deletion.

johnm9

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Code generation include deleted associations
« Reply #6 on: June 20, 2008, 12:29:14 pm »
Hi EA Admin,
I've figure out the problem and I have what I want now.

But from the user point of view, I strongly suggest you to make that "prompt for delete" option on as default. I guess 100% user wants that in default.

Thanks for your prompt reply again. It is very helpful and I appreciated it very much.