• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

application scope components

Explorer ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

I've been building an image gallery application using components.

In my application file I have
<cfset application.gallery = createObject("component","app.gallery").init(application.dsn)>

Now every time I want to generate a gallery I do this
<cfset Variables.Gallery = application.gallery.getGallery(URL.fromRec,URL.count,URL.continent,URL.country,URL.city,"#URL.pic#")>

It just occured to me that this may be a problem. I this ok, or will I be affecting every users gallery on the site, by doing this under the application scope?


TOPICS
Advanced techniques

Views

180

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 29, 2006 Jun 29, 2006
I think it's OK. You apparently define just one instance of application.gallery. If you don't update it throughout the life of the application, there will be no race conditions. Also, 'variables' is not a shared scope, and so variables.gallery will always be local.




Votes

Translate

Translate
Community Expert ,
Jun 29, 2006 Jun 29, 2006

Copy link to clipboard

Copied

LATEST
I think it's OK. You apparently define just one instance of application.gallery. If you don't update it throughout the life of the application, there will be no race conditions. Also, 'variables' is not a shared scope, and so variables.gallery will always be local.




Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation