Probably the easiest solution I can think of off the top of my head:

When you get the object from the pool you call some method
pool.getObj() - and when your done with it you could just
pool.returnObj() where the object gets cleaned out and put back in the
pool ready for later user.


Imagine inside the pool manager you have two arrays... array 1 holds
the available items, array 2 holds the items being used.

When you call pool.getObj() it passes back a reference to you, but
also stores a referencein the used arrray and removes the reference
from the available array.

then when you call returnObj() it reverses the process.

Each of the objects managed by your pool would need to be uniquely
identifiable (something recently discussed on this list) and voila'
you have a very simple pool setup.

But as Sean and Barney both said - probably not something you will
ever need to muck with.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to