[openbeos] Re: Pointer or reference?

  • From: "Bruno van Dooren" <bruno_van_dooren@xxxxxxxxxxx>
  • To: <openbeos@xxxxxxxxxxxxx>
  • Date: Thu, 1 Apr 2004 09:58:41 +0200

> 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?

in some applications it is not even possible to do this because the state
may represent
the actual state of a robot. deleting and creating a new motor control
object will
cause the robot to perform initialization functions, which is probably not
what you want
except at the startup of your application.

and even if you can restore the state of an object, this can cost a lot of
time if you are working
with database connection objects or such things.

kind regards,
    Bruno.

Other related posts: