Joe made a fine point. Just because you instantiate a CFC on a page that
gets called does NOT mean it'll die after the page request is through IF you
instantiate it into the SERVER, APPLICATION or SESSION scope.

That said, I use this method, in my Application file, to instantiate
commonly used CFCs.

<cfscript>
        // intialize the query manager CFC
        APPLICATION.queryObj = CreateObject("component", 
"includes.queryManager");
</cfscript>

And let's be honest here...if they weren't commonly used, we probably
wouldnt' make them into a CFC now would we?

<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Joe Rinehart [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 7:14 AM
To: CF-Talk
Subject: Re: CFC Lifecycle


Hey Andy,

> If I create an instance of a CFC on my page, carry out some processing
> and then do cflocate to another page am I correct in assuming that
> my CFC instance is now gone and if I wish to re-use it I must create
> another instance of it?

Exactly!  A CFC instance is just a variable like any other - put it in
the unnamed/variables scope and it only hangs out for the duration of
the page.  Put it in application/session, and it'll stick around.

-Joe

--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220885
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to