I have a question about the singleton pattern. If I use ColdSpring to create singleton gateways of say my user and role gateways, if I call the gateway from multiple funtions within a CFC am I get a fresh copy of the gateway or record object each time? or do I need to assume that the object needs to be cleared for example on an iterator object.

Thanks for the clarification.

- JS

On 7/9/06, Doug Hughes <[EMAIL PROTECTED]> wrote:

FYI, in production mode Reactor only created singletons.  Anything that's stateless is cached in ram.

 

Doug

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Simeon Bateman
Sent: Sunday, July 09, 2006 2:02 PM
To: [email protected]
Subject: Re: [Reactor for CF] Re: MG Unity / Reactor - getModelGlue().getORMService()

 

The syntax for what sean is suggesting looks like

<bean id="memberGateway" factory-bean="ormService" factory-method="createGateway">
        <constructor-arg name="objectAlias">
            <value>member</value>
        </constructor-arg>
    </bean>

that will create a singleton of your gateway that can be requested from coldspring or used in any other service object.

simeon

On 7/8/06, Sean Corfield <[EMAIL PROTECTED]> wrote:

On 7/7/06, Doug Sims < [EMAIL PROTECTED]> wrote:
> In my controllers I have been using getModelGlue().getORMService() to get
> access to the reactor factory.
>
> Now I have a need to extend a reactor generated record to return query
> results from a gateway (for a non-primary key relationship I can not seem
> define in the reactor XML)

So you write that extra code into the database-specific generated
gateway CFC (in the data directory) and then Reactor automatically
uses that.

> How can I get access to  to the reactor factory to create a gateway to use
> in my extended reactor record? i would rather not just use create object as
> somehow unity or coldspring should help...right?

You can define the gateway object as a bean in the ColdSpring XML file
and tell it to use the reactoryFactory as a factory-bean and the
createGateway() as the factory-method (with a constructor-arg that is
the name of the table).
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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