Robertson-Ravo, Neil (RX) wrote:
> Well, it's doesn't make any programmatic sense for a start.  They are static
> providing a common layer of functionality, to put them into a scope other
> than application or server (to a degree) just doesn't make any sense. 

But what if they aren't static?


> They can be very memory intensive so giving each "user" their own session
> CFC which is identical to ever other users doesn't make any sense as it
> would be needless consumption of memory space.

Memory is cheap, it can be a reasonable price for encapsulation.


> You also cannot use replication with them in session scope (this may have
> been fixed in CF7/JRun updater, I know it was true before)

In case of a userBean.cfc that is easily worked around by having a 
second session variable with just the userID that reinits the component:
<cfif NOT StructKeyExists(session, "currentUser") OR NOT 
IsObject(session.currentUser) OR NOT 
isInstanceOf(obj=session.currentUser, reqType="UserBean")>
   <cfset currentUser = getBean("UserBean").init(session.userID)>
   <cfset session.currentUser = currentUser>
</cfif>
See http://www.feed-squirrel.com/index.cfm?evt=viewItem&ID=4983 for an 
isInstanceOf() function. It isn't pretty but does the job until we have 
true replication of objects in sessions.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274732
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to