I know that when using J2EE session clustering, CFCs cannot be placed into
the session scope since CFCs cannot currently be serialized.  I'm curious to
know if anyone knows if CFC serialization is on the horizon or not.  If so,
I am considering building a sessionFacade.cfc to "fake" a user CFC being
stored in the session scope by passing memento data back and forth in the
session scope.

It'll likely have some (unknown) impact on performance, but if I can do this
it leaves my change point very small once serialization is introduced.  I've
attached a little sample of the userFacade.cfc in case I've been unclear on
what I am doing.

Does anyone have any comments?  Has anyone tried this before?  Is
serialization on the horizon?  Will Brenda and Dylan ever get back together
again?

-Cameron

PS: We are using J2EE session clustering and I would prefer not to use
sticky sessions.

-----------------
Cameron Childress
Sumo Consulting Inc.
http://www.sumoc.com
---
cell:  678.637.5072
aim:   cameroncf
email: [EMAIL PROTECTED]


<cfcomponent displayname="User Facade">

        <cffunction name="init" access="public" returntype="userFacade">
                <cfreturn this />
        </cffunction>

        <cffunction name="getUser" access="public" returntype="user">
                <cfscript>
                var user        = createObject("component","user").init();

                if (not hasUser()){
                        setUser(user);
                }
                user.setMemento(session.user);
                </cfscript>
                <cfreturn user />
        </cffunction>

        <cffunction name="setUser" access="public" returntype="void">
                <cfargument name="user" type="user" required="true" />
                <cfset session.user = arguments.user.getMemento() >
        </cffunction>

        <cffunction name="resetUser" access="public" returntype="void">
                <cfscript>
                var user        = createObject("component","user").init();
                setUser(user);
                </cfscript>
        </cffunction>

        <cffunction name="hasUser" access="private" returntype="boolean">
                <cfreturn (isDefined("session.user")) />
        </cffunction>

</cfcomponent>



----------------------------------------------------------
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