[openbeos] Re: Pointer or reference?

  • From: Timothy Scriven <batty_ousemoosik@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 1 Apr 2004 05:10:57 -0800 (PST)

What kind of object would you want to leave in an orphaned state, lying around 
in case you want to use it again?  Seems to me that it'd be just tying up 
resources, saving its state would in my opinion be preferable.  Restore it if 
and when it's needed.

An object with a high chance of being required again is not likely to find 
itself orphaned in the first place.

Tim :)


________________________________
Timothy Scriven
+61409926381

batty_ousemoosik@xxxxxxxxxxxxxxx



--- "Scott MacMaster" <scott@xxxxxxxxxxxxxxxxxx> wrote:
> > First, I would not want my objects to automatically be destroyed when
> > they
> > are removed from the hierarchy, because I may want to use the object
> > somewhere else.
>
> Wouldn't you instantiate a new instance of the object in that case?

If I want to use the object somewhere else, I probably want the object to be
in the same state.  If I were to let the object be deleted and then create a
new instance later, I'd have to save it's state and then restore it.  What
possible benefit could I get from that?


Later,
Scott MacMaster



Other related posts: