Kay,
I see what you are trying to do.  What you were attempting perhaps was a
scope facade.

I would suggest something like:


<cfset sFacade = createObject("component","config").setScope("application")>

<cfset sFacade.setVariable("variableName",variableValue)>

This was you just add variables to the scope that you initialize with and
then you can use getters and setters to have an agnostic way of setting
values into scope inside of other CFCs.  I like these approaches as I
typically do not want to put shared scopes into my CFCs.

Teddy




On 1/13/07, Matt Quackenbush <[EMAIL PROTECTED]> wrote:
>
> To set the struct in your example into the application scope, you'd simply
> set it to an application-scoped variable when calling the method.
>
> <cfinvoke component="cfc.config" method="SetVariables" returnvariable="
> application.config">
>
> Dave already answered your "why not" question, so I'll just say: "yeah,
> what
> he said!"  :-)
>
> HTH
>
>
> Matt
>
>
> On 1/12/07, Kay Smoljak <[EMAIL PROTECTED]> wrote:
> >
> > >The variables from within the CFC will NOT go to the application scope.
> > >They belong to the CFC itself.
> >
> > Maybe I should be clearer - I am using the CFC to return values that I
> > want to use in other parts of the application - eg a simplified version
> of
> > what is does is this:
> >
> > <cffunction name="SetVariables" returntype="struct">
> >   <cfset var config=StructNew()>
> >   <cfset config.foo="bar">
> >   <cfreturn config>
> > </cffunction>
> >
> > > Also, I doubt very much that you'll find
> > > many that will condone using returnvariable="application" .
> >
> > Well, what I want to know is why. It surprised me that it worked, and it
> > doesn't seem to smell right to me. Is it a bad practise and if so,
> what's
> > the reason?
> >
> > Cheers,
> > K.
> >
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266604
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