>Just an idea. If the session is created but not the instance, couldn't
>you use something like the IsCFC UDF from cflib.org
>(http://www.cflib.org/udf.cfm?ID=743) to check if the CFC has been
>instantiated. If is not, then instantiate the component as in:
>
><cfif IsDefined("session.FOO")> 
>     <cfif not isCFC(session.FOO)>
>          <cfset session.FOO = createObject("component",
>"pathToFoo").init(whatever)>
>     </cfif>
>     <cfset session.FOO.sendMessage("hello world")> 
></cfif>
>
Yes, you could do that.

>You still wouldn't have the data that was associated with the 
>CFC in the
>first place, but this may work. Either that or switch to Blue Dragon,
>which does full session replication.

An idea would be to implement the memento pattern using structs and put
THAT in the session. Think of it as a way to replicate a cfc instance's
data without behavior. You would use the same code as your example,
except:

<cfset session.FOO =
createObject("component","pathToFoo").init(whatever)>
becomes
<cfset session.FOO =
createObject("component","pathToFoo").setMemento(session.FOODATA)>


/t


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/[email protected]

Reply via email to