|
-
It is almost always more efficient to re-use an object rather than throw one away and build another just like it. The general principle at work here is an "object pool" and you can learn more by searching for that phrase.
You do not need to do any of the identity number stuff that flashmed is suggesting, which seems to be aimed at creating a unique instance name for the instance. You don't need to give them names at all, so you don't need unique names. Instead, just put your instances in a collection like an Array or Vector. Maybe one collection for live instances and one for "reserve" instances, depending on what sort of processing you need to do on the live ones, and the expected ratio between live and inactive.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|