On 26/11/2007, Mike Kear <[EMAIL PROTECTED]> wrote:
>
> I am really enjoying the way coldspring has taken care of a lot of the
> details of getting components instantiated correctly.
>
> My habit in the past has been ot instantiate all the components a page
> requires at the top of the page, which of course is not the best way to do
> things. As you've advised me here, my fear that putting CFCs into shared
> scopes would end up filling the RAM in a shared host is unfounded.
>
> But how to instantiate a cfc as a singleton?
>
> Should I do this in the application.cfc onApplicationStart() method?
>
> <cfset application.catalogDAO=application.beanfactory.getBean
> ("catalogDAO")
> />
>
> Or is there a coldspring-automated way of doing it?
>
A question on ColdSpring I can answer!! :D
By default, ColdSpring instantiates your cfc beans as singletons. You
actually have to tell CS not to instantiate a bean as singleton. This is
done using singleton="false" as an attribute in the bean tag.
Regards
Stephen
--
Stephen Moretti
Blog : http://nil.checksite.co.uk/
Twitter : http://twitter.com/mr_nil