On 4/30/07, Aaron DC <[EMAIL PROTECTED]> wrote:
Option 3: I want to run (not necessarily clean up) code when the object
is (about to be) destroyed.

But you have no guarantee of when that might happen - it could be
hours after the request that created the CFC. It may never happen. The
same is true in Java. Whilst you *are* guaranteed that finalize() is
called by the garbage collector if it determines there are no longer
any references to your object, you have *no* guarantee of when or if
that might happen. You can have objects floating around "forever" that
may never be destroyed if the GC doesn't need the space.

This is unlike C++, however, where objects are explicitly destroyed
(e.g., when the go out of scope or when the programmer deletes them).
In C++, destructors are guaranteed to be called in predictable ways
and on predictable timelines.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/cfcdev@cfczone.org

Reply via email to