RAM may be cheap for your machine but your are obviously still going to be
limited by heap and overall application performance / memory consumption.





"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Jochem van Dieten
To: CF-Talk
Sent: Fri Apr 06 21:41:01 2007
Subject: Re: Using CFCs in session scope - need cflock help

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-OT/message.cfm/messageid:269
Subscription: http://www.houseoffusion.com/groups/CF-OT/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.29

Reply via email to