Book a Demo

Author Topic: Object destruction automatically inserted?  (Read 4752 times)

alzamabar

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Object destruction automatically inserted?
« on: March 08, 2009, 08:30:40 pm »
Hi, I'm designing a SD. I used a message of type 'New' which created an object. The problem is that it automatically also created the signature for destroy (an 'X' at the end of the lifeline). According to the UML specification the 'X' should appear as consequence of a destroy() method. I think this is a bug.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Object destruction automatically inserted?
« Reply #1 on: March 10, 2009, 12:39:56 am »
I'm not sure if this affects drawing a sequence diagram, but just in case...

Check the Tools | Options | Diagram | Sequence dialog. The GarbageCollect (auto delete) setting - which is checked by default I think - will probably cause a termination (destructor) to be added to the object lifeline.

Also check the Tools | Options | Source Code Engineering | Object Lifetimes dialog. You should see several settings under the Destructor heading. I believe Generate Destructor is on by default.

Try turning this off. It won't retroactively affect your work to date, but it might change how EA handles new diagrams.

HTH, David
No, you can't have it!

alzamabar

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Object destruction automatically inserted?
« Reply #2 on: March 10, 2009, 06:51:43 am »
Hi David, that worked.

Thanks.

M.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Object destruction automatically inserted?
« Reply #3 on: March 10, 2009, 09:29:41 pm »
But which one?

Given my spotty memory about which setting would work (or if they would work at all) it could help the rest of us to know.
No, you can't have it!

alzamabar

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Object destruction automatically inserted?
« Reply #4 on: March 11, 2009, 08:11:27 am »
I've tried both, but I guess that the Garbage collector one would have done the trick

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Object destruction automatically inserted?
« Reply #5 on: March 11, 2009, 08:50:34 am »
That sounds right. The second suggestion was more along the lines of "... and if that doesn't work here's a long shot."

Thanks for clearing this up. Since I seem to keep forgetting this detail, you are probably helping others who might need to know this.

David
No, you can't have it!