Most people do put Reactor into the application scope at application initialization. Or, more specifically, they pass it into the application-scoped service objects that will actually use it.

Did you mean "any reason why I should" or "any reason why I *shouldn't*"?

Regards,

Brian

On 5/11/06, Nick Tong - TalkWebSolutions.co.uk < [EMAIL PROTECTED]> wrote:
Sorry newbe question and i can't find an archive for this list:

is there any reason why i should put reactor in the application scope so i don't have to instantiate it each page request:

i.e.
application.cfm

<cfif not structKeyExists( application, 'appInitialized' )>
    <cflock name="appInitBlock" type="exclusive" timeout="10">
        <cfif not structKeyExists( application, 'appInitialized' )>
            <!--- create the reactorFactory --->
            <cfset application.Reactor = CreateObject("Component", "reactor.reactorFactory").init(expandPath("reactor.xml")) />
        </cfif>
    </cflock>
</cfif>

then any calls after i use the application scope:
i.e.
<cfset UserGateway = application.reactor.createGateway("User") />

thanks.
--
Nick Tong

web: http://talkwebsolutions.co.uk
blog: http://succor.co.uk
shorturls: http://wapurl.co.uk -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to