Book a Demo

Author Topic: Object lifetime in sequence diagrams  (Read 3246 times)

warmachine

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I'm not prejudiced.  I hate everyone equally!
    • View Profile
Object lifetime in sequence diagrams
« on: March 08, 2005, 03:41:44 am »
I can't work out how to prevent the deletion of an object after its creator has finished with it and passed it to something else.  Currently, the object appears to be created, has a few properties set, then dies.  This is confusing to read as it's kept by a cache that hangs around for a long time.
Matthew Greet
[email protected]

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Object lifetime in sequence diagrams
« Reply #1 on: March 08, 2005, 08:30:46 am »
Surely since all references will be via the cache (otherwise how does it get used), the cache will be involved in the sequence diagram too, holding a reference to the object [Proxy pattern], and so the object will only die when the cache decides it doesn't need it or can't hold it any more.

Or did I misunderstand ?

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Object lifetime in sequence diagrams
« Reply #2 on: March 08, 2005, 01:56:13 pm »
Object lifetime vs. focus of control????
"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.

warmachine

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I'm not prejudiced.  I hate everyone equally!
    • View Profile
Re: Object lifetime in sequence diagrams
« Reply #3 on: March 09, 2005, 03:32:04 am »
Quote
Surely since all references will be via the cache (otherwise how does it get used), the cache will be involved in the sequence diagram too, holding a reference to the object [Proxy pattern], and so the object will only die when the cache decides it doesn't need it or can't hold it any more.


Indeed, that is how it works and the cache is on the diagram with the function to store the object in it.  There is no way to state that a function parameter is stored in object state (not that I want that in a CASE tool).  But the created object still dies.
Matthew Greet
[email protected]