Basically, I have this:
<cffunction name="loadMessageHandler"
access="private" returntype="messageHandler" output="False">
<cfreturn createObject("component","messageHandler") />
</cffunction>
<cffunction name="setMessageHandler" access="private"
returntype="boolean" output="False">
<cfargument name="messageHandler" type="messageHandler"
required="True" />
<cfset variables.properties.messageHandler =
arguments.messageHandler />
<cfreturn True />
</cffunction>
<cffunction name="getMH" access="private"
returntype="messageHandler" output="false">
<cfreturn variables.properties.messageHandler />
</cffunction>
When the dao object is created and the daos init() is called, it runs
setMessageHandler(loadMessageHandler()) and then when each function
runs at the top I do <cfset VAR mh = getMH() /> and then call
mh.init().
On 10/25/05, Sean Corfield <[EMAIL PROTECTED]> wrote:
> It's a little hard to figure out what you're doing without seeing your code...
>
> <cfset VAR mh = getMH() />
>
> That creates a local reference to whatever getMH() returns. We'd need
> to see the body of getMH() to answer the rest of your questions I
> think.
>
> On 10/25/05, Ryan Guill <[EMAIL PROTECTED]> wrote:
> > I have a component that I am using in composition in some of my other
> > components. I have a messageHandler, which an object is being created
> > of in all of my daos. In every method that runs, it inits() or resets
> > the object, the method uses the messageHandler methods, it then
> > returns the information stored in the message handler. then the next
> > method that runs will init() and reset it again and the process
> > repeats.
> >
> > I am createing an object out of the messageHandler in every dao when
> > the dao object is created and then the same messageHandler object is
> > being reused over and over. I am bringing it into each method like so
> > <cfset VAR mh = getMH() /> and getMH() just returns the reference to
> > the object.
> >
> > So my question is this: since i am using VAR inside each of the
> > methods, is it really creating it locally? My worry is that it is not
> > even still, and so if one method of my dao starts to run, and another
> > method starts to run before the first one is completed will the init()
> > of the second method clear out the data of the first ones instance?
> >
> > If so, then the only way I see around this is to create the
> > messageHandler object for each method, or put exclusive locks in every
> > method. I hope this really isnt the case...
>
>
> ----------------------------------------------------------
> 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]
>
>
>
--
Ryan Guill
BlueEyesDevelopment
[EMAIL PROTECTED]
www.ryanguill.com
(270) 217.2399
got google talk? Chat me at [EMAIL PROTECTED]
The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com
www.ryanguill.com/
The Roman Empire: www.ryanguill.com/blog/
----------------------------------------------------------
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]