> I'm still not understanding what you're saying about using > the cached version. > > Are you saying that if I run a CFC method called getCart() > and it returns a query called variables.theCart, I should be > able to use that query on additional CFCs? >
No. What I mean is this: When you create a variable, in a CFC, in the variables scope, it is available to all other methods of a CFC. So, take this simple example <cfcomponent> <cfset variables.name = "Jedi"> <cffunction name="test"> <cfreturn variables.name> </cffunction> </cfcomponent> In this example, I create a variable, variables.name. Since it exists in the variables scope, any method (in this case, test) can use it. Now let's take a look at anther example using queries. Warning, part of this is pseudo-code: <cfcomponent> <cffunction name="getCart"> <cfif not isDefined("variables.cartQuery")> run a query. name is variables.cartQuery </cfif> <cfreturn variables.cartQuery> </cffunction> </cfcomponent> This component will only run the query once. However, the cfc itself must be cached. For example: <cfif not isDefined("session.cart")> <cfset session.cart = createObject("component","cart")> </cfif> <cfset mycrap = session.cart.getCart()> Does this help some? ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email : [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]