Josh,

Gateways are (for intensive purposes) stateless - they have no data to clear.

Records, by definition, have state - any data 'loaded' into them (such
as child records in an interator) remains as-is until explicitly
reset.

In other words, if you do two calls to Reactor for the same type of
gateway, each call will get a reference to the same instance.

Two calls to Reactor for the same type of record will each result in a
separate instance of th e record.

-Joe

On 7/9/06, Joshua Scott <[EMAIL PROTECTED]> wrote:
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --


--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com


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

Reply via email to