Book a Demo

Author Topic: Extending sequence element lifecyle  (Read 7809 times)

ASP

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Extending sequence element lifecyle
« on: July 24, 2008, 12:37:08 am »
The following occurs in a portion of a sequence diagram for a UML class:

1. There is a sequence element that depicts a class [class A] instance. Within its lifecycle, it instantiates a second class [class B]. The message that invokes the class B constructor has its lifecycle message property set to "New". Since I have the "GarbageCollect" option selected (Tools > Options... > Diagram > Sequence), the sequence diagram reveals a lifecycle termination point (ie, X) on the class B object.

2. The class B object invokes some internal methods.

3. The class A object then instantiates another class [class C]. The class B object will continue to be referenced in the class A object. However, the sequence diagram does not allow me to extend the class B lifecycle termination point beyond the new message (ie, the message that invokes the class C constructor). This makes it appear that the class B object falls out of scope and is deleted, but this is not the case. I need the class B object to persist within the scope of the class A object.

How can I visually extend the life of the class B object in this diagram?

Thanks.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extending sequence element lifecyle
« Reply #1 on: July 24, 2008, 02:50:25 am »
Check out Layout | Of Sequence Diagrams in the EA help index. [I keep missing this since I think of layout as applying to class positioning, but I suppose it makes sense.]

I think you should be able to click and drag, but note the cautions on the help page.
No, you can't have it!

ASP

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Extending sequence element lifecyle
« Reply #2 on: July 24, 2008, 04:00:02 am »
Midnight,

Thanks for the reply. That was actually the first thing I tried, but it does not work for sequence elements that depict a lifecycle termination symbol (ie, the "X").

Any thoughts? Thanks.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extending sequence element lifecyle
« Reply #3 on: July 24, 2008, 04:39:47 am »
I thought there was some setting you could use to extend the termination marker.

Have you tried right-clicking to see if there are context menu settings?

Otherwise, search the forum for this - including the termination. I'm sure I saw something about how this works posted by a Sparxian. It was some time ago, but almost certainly in the past year or so.

David
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extending sequence element lifecyle
« Reply #4 on: July 24, 2008, 04:54:18 am »
What I might have been thinking of was the Denote Lifecycle of an Element page in EA help. Check the forum anyway, since this page doesn't seem to give us much information about moving the 'X' down the line at all.
No, you can't have it!

ASP

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Extending sequence element lifecyle
« Reply #5 on: July 24, 2008, 05:50:45 am »
Midnight,

Thanks for the reply.

In version 6.5.803, there is no ability to directly alter the position of the lifecycle termination symbol; don't know about later versions. Also, as far as I can tell, the only way to include the symbol [after having set the appropriate "Tools" options] is to alter the message property of the message invoking the object.

I've searched the forum on various terms and phrases, including the one you suggested. Only messages from this thread are returned.

By the way, I've noticed another strange behavior as I continue to work on this sequence diagram. Namely, I need to instantiate other classes further down in the sequence. Unfortunately, the termination symbol no longer appears when I send messages invoking class constructors and set the message lifecycle properties to "New".

Weird. Thanks again for your feedback.


Anthony

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extending sequence element lifecyle
« Reply #6 on: July 24, 2008, 06:09:47 am »
Anthony,

Did you try turning on garbage collection? That's the advice in the help file for build 831. Despite the fact that the EA version is different (7.1 versus 6.5) perhaps this is only a documentation change. The reference I saw in the forum certainly dates back to around version 7.0 or earlier.

David

PS: Remember, you can always download the most recent help file from the Sparx site. [I think it is also part of the EA Lite kit as well.]
« Last Edit: July 24, 2008, 06:11:15 am by Midnight »
No, you can't have it!

ASP

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Extending sequence element lifecyle
« Reply #7 on: July 24, 2008, 07:10:11 am »
David,

I've found a work-around, or perhaps this is how it should work. Not having seen this in the documentation, I'm not sure.

Simply create another message and set its lifecycle property to "Delete". Then drag that message at will. I labeled my "delete" message as follows: "(falls out of scope)". It doesn't really matter when the object reference is removed from memory (in the case of Java). I simply want to show when the reference object variable is no longer in scope.

Any thoughts? Thanks.


Anthony

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extending sequence element lifecyle
« Reply #8 on: July 24, 2008, 07:36:33 am »
Good stuff Anthony,

This sounds something like what I saw, or think I did...

I suspect this is somehow related to the garbage collection thing in the current help file.

I still suggest you pull that file down and take a look.

The main thing is that you're not still stuck, or at least not as much so.

David
No, you can't have it!

ASP

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Extending sequence element lifecyle
« Reply #9 on: July 25, 2008, 05:17:25 am »
Thanks for your feedback, David.

Incidentally, can you provide a link to the help file you mentioned in this thread? Thanks.


Anthony

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extending sequence element lifecyle
« Reply #10 on: July 25, 2008, 07:16:52 am »
I am referring to the help for build 831, though this page has probably been around for a while. You'll find this file on the EA downloads page. I believe it is also installed when you set up the evaluation version or EA Lite.

The page you need can be found in the index under the heading Denote Lifecycle for an Element.
« Last Edit: July 25, 2008, 07:17:36 am by Midnight »
No, you can't have it!