It should be a singleton. You do not want to recreate the coldspring factory
on every request.
If you get a chance check out the Fusebox coldspring lexicon.

http://corfield.org/blog/index.cfm/do/blog.entry/entry/Fusebox_5_and_ColdSpring

On Thu, Apr 30, 2009 at 10:50 PM, Gavin Baumanis <beauecli...@gmail.com>wrote:

>
> Hi Everyone,
>
> I have the following code in my index.cfm
> Which is part of a fusebox application.
> Thus EVERY request goes through index.cfm
>
> <!--- Initialize ColdSpring --->
> <cfset coldspringConfig = 'coldspring.xml' />
>
> <cfset properties = StructNew() />
> <cfset properties.dsnName = "itw_local" />
>
> <cfset application.beanFactory = CreateObject('component',
> 'coldspring.beans.DefaultXmlBeanFactory').init
> (defaultProperties=properties) />
>
> <cfset application.beanFactory.loadBeans(coldspringConfig) />
>
> My question is, should the bean factory be created as a singleton?
> Should I wrap it in something like;
>    if(NOT StructKeyExists(application, "beanFactory"))
>
> Or is it appropriate to recreate in on every request?
>
> if it should be a singleton, following on from my previous tinkering
> with Transfer - I assume the service CFCs (Managers / gateways) should
> also be singletons?
>
>
> Thanks.
> >
>


-- 
"anything you say can/will be used against you--
--nothing you say can/will be used to help you."
-Professor James Duane

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to