[cfaussie] Re: Request VS Application Scope

2007-04-26 Thread KC Kuok

Hi Andrew,

Could you point you which part of the code hits the DB everytime? I
currently have my login 'scripts' (more of files stored in its old
folders) called via template when needed at work. I thought this is a
pretty efficient and simple way of authentication, just wondering
where this part of the code that hits the DB unnecessarily.

Thanks in advance,
KC Kuok

On Apr 26, 3:53 pm, Andrew Scott <[EMAIL PROTECTED]> wrote:
> Well I will say it is a very well written article, but it hits the database
> each and every request now although minimal impact it can create a
> networking bottleneck on heavy sites.
>
> The most common and preferred method would be to once it is authenticated to
> stick the info into a session variable, and check against that before having
> to re hit the database for a valid login.
>
> As far as request goes that only lives for the current request, so by
> placing the data into that scope you are running that code each and every
> page request and again, this is an overhead that can be cut with a change in
> the way it is coded.
>
> Don't get me wrong, each to their own. Personally that method of hitting the
> DB, and then storing in the request scope is an overhead that really should
> be avoided if possible.
>
> Andrew Scott
> Senior Coldfusion Developer
> Aegeon Pty. Ltd.www.aegeon.com.au
> Phone: +613  8676 4223
> Mobile: 0404 998 273
>
>
>
> -Original Message-
> From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> Of KC Kuok
> Sent: Thursday, 26 April 2007 3:14 PM
> To: cfaussie
> Subject: [cfaussie] Re: Request VS Application Scope
>
> I thought it was a fairly good tutorial link... care to enlighten me
> which part was running code unnecessarily?
>
> Cheers.
> KC Kuok
>
> On Apr 26, 2:13 pm, Andrew Scott <[EMAIL PROTECTED]> wrote:
> > That is a typical example of running code unnecessarily..
>
> > Andrew Scott
> > Senior Coldfusion Developer
> > Aegeon Pty. Ltd.www.aegeon.com.au
> > Phone: +613  8676 4223
> > Mobile: 0404 998 273
>
> > -----Original Message-
> > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf
>
> > Of elAdi
> > Sent: Thursday, 26 April 2007 1:50 PM
> > To: cfaussie
> > Subject: [cfaussie] Re: Request VS Application Scope
>
> > Here's a tutorial that implements user authentication through
> > application.cfc and uses request variables. Might shed some light into
> > it - not theoretically, but practically.
>
> >http://www.trajiklyhip.com/tutorials/loginSecurityCF7/loginSecurityCF...
> Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-26 Thread Andrew Scott
But it was very well documented for a tutorial, can't take that away from
it:-)


On 4/26/07, elAdi <[EMAIL PROTECTED]> wrote:
>
>
> I do agree with you Andrew. I just posted the link as an illustration.
> I stumbled across it when looking for other authentication methods
> than the one I used so far. You know: never stop learning. But after
> playing around with it for a while, I too found that there is too much
> 'duplication' (as in doing the same thing over and over again) going
> on. Also, I'm currently working at a little site where particular
> pages show additional info when a user is logged in. The request scope
> would make it awkward to develop such a solution. Using the session
> scope for authentication is going to make it a walk in the park to
> develop that particular solution. So yeah, until further notice, I'll
> stick with app and session scope for authentication as well.
>
>
> >
>


-- 



Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-26 Thread elAdi

I do agree with you Andrew. I just posted the link as an illustration.
I stumbled across it when looking for other authentication methods
than the one I used so far. You know: never stop learning. But after
playing around with it for a while, I too found that there is too much
'duplication' (as in doing the same thing over and over again) going
on. Also, I'm currently working at a little site where particular
pages show additional info when a user is logged in. The request scope
would make it awkward to develop such a solution. Using the session
scope for authentication is going to make it a walk in the park to
develop that particular solution. So yeah, until further notice, I'll
stick with app and session scope for authentication as well.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-25 Thread Andrew Scott

Well I will say it is a very well written article, but it hits the database
each and every request now although minimal impact it can create a
networking bottleneck on heavy sites.

The most common and preferred method would be to once it is authenticated to
stick the info into a session variable, and check against that before having
to re hit the database for a valid login.

As far as request goes that only lives for the current request, so by
placing the data into that scope you are running that code each and every
page request and again, this is an overhead that can be cut with a change in
the way it is coded.

Don't get me wrong, each to their own. Personally that method of hitting the
DB, and then storing in the request scope is an overhead that really should
be avoided if possible.



Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273



-Original Message-
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of KC Kuok
Sent: Thursday, 26 April 2007 3:14 PM
To: cfaussie
Subject: [cfaussie] Re: Request VS Application Scope


I thought it was a fairly good tutorial link... care to enlighten me
which part was running code unnecessarily?

Cheers.
KC Kuok

On Apr 26, 2:13 pm, Andrew Scott <[EMAIL PROTECTED]> wrote:
> That is a typical example of running code unnecessarily..
>
> Andrew Scott
> Senior Coldfusion Developer
> Aegeon Pty. Ltd.www.aegeon.com.au
> Phone: +613  8676 4223
> Mobile: 0404 998 273
>
>
>
> -Original Message-
> From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf
>
> Of elAdi
> Sent: Thursday, 26 April 2007 1:50 PM
> To: cfaussie
> Subject: [cfaussie] Re: Request VS Application Scope
>
> Here's a tutorial that implements user authentication through
> application.cfc and uses request variables. Might shed some light into
> it - not theoretically, but practically.
>
> http://www.trajiklyhip.com/tutorials/loginSecurityCF7/loginSecurityCF...-
Hide quoted text -
>
> - Show quoted text -




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-25 Thread [EMAIL PROTECTED]

Hi All,

Thanks to each and every one of you for inputting your thoughts about
this topic.

I completely understand the difference now and see the uses of each.

I still feel the application scope is perfect for what i am doing and
works fine.

Thanks heaps,
Rony Fayyad

On Apr 26, 3:14 pm, KC Kuok <[EMAIL PROTECTED]> wrote:
> I thought it was a fairly good tutorial link... care to enlighten me
> which part was running code unnecessarily?
>
> Cheers.
> KC Kuok
>
> On Apr 26, 2:13 pm, Andrew Scott <[EMAIL PROTECTED]> wrote:
>
> > That is a typical example of running code unnecessarily..
>
> > Andrew Scott
> > Senior Coldfusion Developer
> > Aegeon Pty. Ltd.www.aegeon.com.au
> > Phone: +613  8676 4223
> > Mobile: 0404 998 273
>
> > -Original Message-
> > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> > Of elAdi
> > Sent: Thursday, 26 April 2007 1:50 PM
> > To: cfaussie
> > Subject: [cfaussie] Re: Request VS Application Scope
>
> > Here's a tutorial that implements user authentication through
> > application.cfc and uses request variables. Might shed some light into
> > it - not theoretically, but practically.
>
> >http://www.trajiklyhip.com/tutorials/loginSecurityCF7/loginSecurityCF...Hide 
> >quoted text -
>
> > - Show quoted text -


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-25 Thread KC Kuok

I thought it was a fairly good tutorial link... care to enlighten me
which part was running code unnecessarily?

Cheers.
KC Kuok

On Apr 26, 2:13 pm, Andrew Scott <[EMAIL PROTECTED]> wrote:
> That is a typical example of running code unnecessarily..
>
> Andrew Scott
> Senior Coldfusion Developer
> Aegeon Pty. Ltd.www.aegeon.com.au
> Phone: +613  8676 4223
> Mobile: 0404 998 273
>
>
>
> -Original Message-
> From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> Of elAdi
> Sent: Thursday, 26 April 2007 1:50 PM
> To: cfaussie
> Subject: [cfaussie] Re: Request VS Application Scope
>
> Here's a tutorial that implements user authentication through
> application.cfc and uses request variables. Might shed some light into
> it - not theoretically, but practically.
>
> http://www.trajiklyhip.com/tutorials/loginSecurityCF7/loginSecurityCF...- 
> Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-25 Thread Andrew Scott

That is a typical example of running code unnecessarily..


Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273



-Original Message-
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of elAdi
Sent: Thursday, 26 April 2007 1:50 PM
To: cfaussie
Subject: [cfaussie] Re: Request VS Application Scope


Here's a tutorial that implements user authentication through
application.cfc and uses request variables. Might shed some light into
it - not theoretically, but practically.

http://www.trajiklyhip.com/tutorials/loginSecurityCF7/loginSecurityCF7_2.cfm




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-25 Thread elAdi

Here's a tutorial that implements user authentication through
application.cfc and uses request variables. Might shed some light into
it - not theoretically, but practically.

http://www.trajiklyhip.com/tutorials/loginSecurityCF7/loginSecurityCF7_2.cfm


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Mike Kear

On 4/24/07, Darren Tracey <[EMAIL PROTECTED]> wrote:
<< values in the Application scope and then move them at the beginning of
> every page into the request scope, so that I only had to lock the
> application scope when this copy was done. In these enlightened days,
> this is not necessary (under normal conditions).

Darren, I'm not wishing to be a nit-picker here, but that was me that said that.

(  Actually yes, I am wishing to be a nit-picker.   )
-- 
Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Darren Tracey

The important thing to realise is how long each of these scopes last,
and where they can be seen.

Server scope is available to every page on the server, regardless of
application name specified.
Their timeout is defined in your Cf administrator, and typically last
for a few days.
Put things in here that are relevant to every application application
and not to specific applications or users.
This scope is empty for the first user of the server, or if no one has
visited the server for the specified timeout period.

Application scope is available to every page that shares the same
application name in your cfapplication tag.
Their timeout is defined in your Cf administrator, and typically last
for a few days.
Put things in here that are relevant to the entire application and not
to specific users.
This scope is empty for the first user of the application, or if no
one has visited the application for the specified timeout period.

Session scope is available to every page that one user calls in their
session within one app.
Their timeout is defined in your Cf administrator, and typically last
for a few hours, or when the user's session timesout.
Put things in here that are relevant to the user's session and not to
just one page.
This scope is empty for the each user when they start a new session,
or if they allow their session to timeout.

Request scope is available to every part of a single page request.
This scope is created when a page load is started and is lost when the
page finishes loading.
Put things in here that are relevant to just this page, where you want
something to be available to several sections of the same page.
This scope is empty at the beginning of each and every page, and is
cleared at the end of each and every page.

Its important to remember to check for whether these variables have
timed out or not, for all cases except for request.
Generally, I'd set a bunch of them in a logical group, high up in the
Application.cfm (or similar) and surround them with a condition that
tests for the existance (isdefined) of one of the variables in the
group (because if one timesout, they'll all timeout). That way they
only get set if they don't exist, but they will always be set if the
don't exist.

And as Andrew was saying, back in the day, I'd have great herds of
values in the Application scope and then move them at the beginning of
every page into the request scope, so that I only had to lock the
application scope when this copy was done. In these enlightened days,
this is not necessary (under normal conditions).

Hope that helps.

Darren Tracey
CFUG QLD Manager
Australia

On Apr 23, 6:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I was wondering what the differences between the request and
> application variables are.
>
> I use the application variable to store the variables that dont change
> much (dsn, page info, page content etc...).
>
> Now i dont seem to understand the request scope and its uses well
> enough to use them.
>
> Can anyone shed some light on this topic for me.
>
> i have read some articles on the net, but they dont seem to explain
> the concept well enough.
>
> Thanks


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Mike Kear

Request scope is less important now that it used to be.  In the days
up to CF5.2, locking was a huge issue whenever you tried to read the
application scope so it was a matter of routine that for each page
request,  you copied all the applicatoin variables into the request
scope and used them throughout your pages rather than application
variables.

Since MX, locking is less of an issue and it's ok to read application
variables without having to lock first in most circumstances.
Therefore there's less need to use the request scope.

Once, in the dim distant pastI used to use request variables
everywhere.  Nowdays i hardly use them at all.

But if you do use request variables, there's nothing wrong with that.

Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Andrew Scott
M@ you meant function..

Variables scope is what you meant for CFC's...



On 4/23/07, M@ Bourke <[EMAIL PROTECTED]> wrote:
>
> The THIS scope is also accessible by the calling page.
> the var (whats the name of this scope/thingo?) is accessible by only the
> current cfc
> cfset var crud = "chuck some crud on it"
>
> On 4/23/07, AJ Mercer <[EMAIL PROTECTED]> wrote:
> >
> > as I understand it, the VARIABLES scope is only available to the current
> > template
> >
> > if you don't specify a scope, it ends up in the VARIABLES scope.
> >
> > I think the THIS scope for CFCs is limited to the CFC
> >
> >
>
> >
>


-- 



Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread M@ Bourke
The THIS scope is also accessible by the calling page.
the var (whats the name of this scope/thingo?) is accessible by only the
current cfc
cfset var crud = "chuck some crud on it"

On 4/23/07, AJ Mercer <[EMAIL PROTECTED]> wrote:
>
> as I understand it, the VARIABLES scope is only available to the current
> template
>
> if you don't specify a scope, it ends up in the VARIABLES scope.
>
> I think the THIS scope for CFCs is limited to the CFC
>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread AJ Mercer
as I understand it, the VARIABLES scope is only available to the current
template

if you don't specify a scope, it ends up in the VARIABLES scope.

I think the THIS scope for CFCs is limited to the CFC


On 4/23/07, Andrew Scott <[EMAIL PROTECTED]> wrote:
>
> Actually that is not true...
>
> All variables in all scopes are accessible in every aspect of coldfusion,
> with excpetion to limitations to CFX tags.
>
>
>
>
> On 4/23/07, christophe albrech <[EMAIL PROTECTED]> wrote:
>
> > Dude, to answer you original question, which is "what the hell is the
> > request scope?" (if I understand you well): the request scope gives you
> > access to the whole HTTP request entity. So you can see it as one round-trip
> > to the server. If inside a template, you have a cfmodule, or a cf_whatever,
> > a variable defined as request.var1, will be visible, whereas a non
> > scoped variable (or really, a variables. variable) is only visible within a
> > given template, and the templates it includes (as in cfinclude).
> >
> > tof
> >
> > On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > Yeah thanks for that.
> > >
> > > So basically, when would you need to be using the request scope?
> > >
> > > I use the application.cfc so i would have all this in my
> > > onrequeststart().
> > >
> > > Thanks once again guys,
> > >
> > > On Apr 23, 7:41 pm, "M@ Bourke" < [EMAIL PROTECTED]>
> > > wrote:
> > > > I'd either put it in your application scope or cache ya query.
> > > > if it's going to be available for every user all the time then
> > > application
> > > > shouldn't be a problem
> > > > if the site's busy and ya setting it to request each page request
> > > for each
> > > > user then it would be using a lot of memory although the memory
> > > would be
> > > > getting cleaned up it would be continually getting filled up.
> > > > I'm not an expert on the inner workings of the cf server but I'd try
> > > the
> > > > application scope and if you don't get any issues with it then for
> > > this case
> > > > just sick with it.
> > > >
> > > > M@
> > > >
> > > > On 4/23/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > >
> > > > > Well i store them in the application scope because i call some
> > > > > function to fetch page information from the database and i wouldnt
> > > > > want them to load on every page request, I would much rather store
> > >
> > > > > them in the app scope and call them from the pages This was
> > > > > implemented to avoid hitting the db all the time for fetch page
> > > > > elements and things like that.
> > > >
> > > > > If i was to place them in the request scope would this mean they
> > > would
> > > > > load on every page request? Obs this isnt what i would want.
> > > >
> > > > > On Apr 23, 7:23 pm, "Peter Tilbrook" < [EMAIL PROTECTED]>
> > > wrote:
> > > > > > No point. In fact an unnecessary overhead.
> > > >
> > > > > > Once the request is finished they are no longer required.
> > > Another page
> > > > > > request - they are used - then zip. No locking or anything
> > > required.
> > > >
> > > > > > Application vars have their place but for - at least how I use
> > > them -
> > > > > like
> > > > > > datasourcenames and such - Request scope is perfectly suitable.
> > > Just
> > > > > declare
> > > > > > them in the Application.cfm so they are available to all page
> > > requests.
> > > >
> > > > > > --
> > > > > > Peter Tilbrook
> > > > > > ColdGen Internet Solutions
> > > > > > President, ACT and Region ColdFusion Users Group
> > > > > > PO Box 2247
> > > > > > Queanbeyan, NSW, 2620
> > > > > > AUSTRALIA
> > > >
> > > > > > http://www.coldgen.com/http://www.actcfug.com/
> > > >
> > > > > > Tel: +61-2-6284-2727
> > > > > > Mob: +61-0432-897-437
> > > >
> > > > > > Email: [EMAIL PROTECTED]
> > > > > > MSN Messenger Live: Desktop General
> > >
> > >
> > >
> > > Aegeon Pty. Ltd.
> > > www.aegeon.com.au
> > > Phone: +613  8676 4223
> > > Mobile: 0404 998 273
> > > > > >
> > >


-- 
If you are not living on the edge,
You are taking up too much space.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Andrew Scott
Actually that is not true...

All variables in all scopes are accessible in every aspect of coldfusion,
with excpetion to limitations to CFX tags.




On 4/23/07, christophe albrech <[EMAIL PROTECTED]> wrote:
>
> Dude, to answer you original question, which is "what the hell is the
> request scope?" (if I understand you well): the request scope gives you
> access to the whole HTTP request entity. So you can see it as one round-trip
> to the server. If inside a template, you have a cfmodule, or a cf_whatever,
> a variable defined as request.var1, will be visible, whereas a non scoped
> variable (or really, a variables. variable) is only visible within a given
> template, and the templates it includes (as in cfinclude).
>
> tof
>
> On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> > Yeah thanks for that.
> >
> > So basically, when would you need to be using the request scope?
> >
> > I use the application.cfc so i would have all this in my
> > onrequeststart().
> >
> > Thanks once again guys,
> >
> > On Apr 23, 7:41 pm, "M@ Bourke" <[EMAIL PROTECTED]>
> > wrote:
> > > I'd either put it in your application scope or cache ya query.
> > > if it's going to be available for every user all the time then
> > application
> > > shouldn't be a problem
> > > if the site's busy and ya setting it to request each page request for
> > each
> > > user then it would be using a lot of memory although the memory would
> > be
> > > getting cleaned up it would be continually getting filled up.
> > > I'm not an expert on the inner workings of the cf server but I'd try
> > the
> > > application scope and if you don't get any issues with it then for
> > this case
> > > just sick with it.
> > >
> > > M@
> > >
> > > On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > > > Well i store them in the application scope because i call some
> > > > function to fetch page information from the database and i wouldnt
> > > > want them to load on every page request, I would much rather store
> > > > them in the app scope and call them from the pages This was
> > > > implemented to avoid hitting the db all the time for fetch page
> > > > elements and things like that.
> > >
> > > > If i was to place them in the request scope would this mean they
> > would
> > > > load on every page request? Obs this isnt what i would want.
> > >
> > > > On Apr 23, 7:23 pm, "Peter Tilbrook" <[EMAIL PROTECTED]>
> > wrote:
> > > > > No point. In fact an unnecessary overhead.
> > >
> > > > > Once the request is finished they are no longer required. Another
> > page
> > > > > request - they are used - then zip. No locking or anything
> > required.
> > >
> > > > > Application vars have their place but for - at least how I use
> > them -
> > > > like
> > > > > datasourcenames and such - Request scope is perfectly suitable.
> > Just
> > > > declare
> > > > > them in the Application.cfm so they are available to all page
> > requests.
> > >
> > > > > --
> > > > > Peter Tilbrook
> > > > > ColdGen Internet Solutions
> > > > > President, ACT and Region ColdFusion Users Group
> > > > > PO Box 2247
> > > > > Queanbeyan, NSW, 2620
> > > > > AUSTRALIA
> > >
> > > > >http://www.coldgen.com/http://www.actcfug.com/
> > >
> > > > > Tel: +61-2-6284-2727
> > > > > Mob: +61-0432-897-437
> > >
> > > > > Email: [EMAIL PROTECTED]
> > > > > MSN Messenger Live: Desktop General
> >
> >
> > > >
> >


-- 



Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread christophe albrech
Dude, to answer you original question, which is "what the hell is the
request scope?" (if I understand you well): the request scope gives you
access to the whole HTTP request entity. So you can see it as one round-trip
to the server. If inside a template, you have a cfmodule, or a cf_whatever,
a variable defined as request.var1, will be visible, whereas a non scoped
variable (or really, a variables. variable) is only visible within a given
template, and the templates it includes (as in cfinclude).

tof

On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Yeah thanks for that.
>
> So basically, when would you need to be using the request scope?
>
> I use the application.cfc so i would have all this in my
> onrequeststart().
>
> Thanks once again guys,
>
> On Apr 23, 7:41 pm, "M@ Bourke" <[EMAIL PROTECTED]>
> wrote:
> > I'd either put it in your application scope or cache ya query.
> > if it's going to be available for every user all the time then
> application
> > shouldn't be a problem
> > if the site's busy and ya setting it to request each page request for
> each
> > user then it would be using a lot of memory although the memory would be
> > getting cleaned up it would be continually getting filled up.
> > I'm not an expert on the inner workings of the cf server but I'd try the
> > application scope and if you don't get any issues with it then for this
> case
> > just sick with it.
> >
> > M@
> >
> > On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Well i store them in the application scope because i call some
> > > function to fetch page information from the database and i wouldnt
> > > want them to load on every page request, I would much rather store
> > > them in the app scope and call them from the pages This was
> > > implemented to avoid hitting the db all the time for fetch page
> > > elements and things like that.
> >
> > > If i was to place them in the request scope would this mean they would
> > > load on every page request? Obs this isnt what i would want.
> >
> > > On Apr 23, 7:23 pm, "Peter Tilbrook" <[EMAIL PROTECTED]> wrote:
> > > > No point. In fact an unnecessary overhead.
> >
> > > > Once the request is finished they are no longer required. Another
> page
> > > > request - they are used - then zip. No locking or anything required.
> >
> > > > Application vars have their place but for - at least how I use them
> -
> > > like
> > > > datasourcenames and such - Request scope is perfectly suitable. Just
> > > declare
> > > > them in the Application.cfm so they are available to all page
> requests.
> >
> > > > --
> > > > Peter Tilbrook
> > > > ColdGen Internet Solutions
> > > > President, ACT and Region ColdFusion Users Group
> > > > PO Box 2247
> > > > Queanbeyan, NSW, 2620
> > > > AUSTRALIA
> >
> > > >http://www.coldgen.com/http://www.actcfug.com/
> >
> > > > Tel: +61-2-6284-2727
> > > > Mob: +61-0432-897-437
> >
> > > > Email: [EMAIL PROTECTED]
> > > > MSN Messenger Live: Desktop General
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Andrew Scott
I agree with M@, things that are going to be constant and apply across the
board to the entire application I would stick in the Application scope. Why
the hell Peter does this in the request scope is beyond reasoning to me.

There is very little need to use the request scope, unless you want a way to
make variables global to all functions, templates.

I'll throw the session scope at you as well, which you can use for the life
of a users session that is not applicable to other users of that
application.



On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Yeah thanks for that.
>
> So basically, when would you need to be using the request scope?
>
> I use the application.cfc so i would have all this in my
> onrequeststart().
>
> Thanks once again guys,
>
> On Apr 23, 7:41 pm, "M@ Bourke" <[EMAIL PROTECTED]>
> wrote:
> > I'd either put it in your application scope or cache ya query.
> > if it's going to be available for every user all the time then
> application
> > shouldn't be a problem
> > if the site's busy and ya setting it to request each page request for
> each
> > user then it would be using a lot of memory although the memory would be
> > getting cleaned up it would be continually getting filled up.
> > I'm not an expert on the inner workings of the cf server but I'd try the
> > application scope and if you don't get any issues with it then for this
> case
> > just sick with it.
> >
> > M@
> >
> > On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Well i store them in the application scope because i call some
> > > function to fetch page information from the database and i wouldnt
> > > want them to load on every page request, I would much rather store
> > > them in the app scope and call them from the pages This was
> > > implemented to avoid hitting the db all the time for fetch page
> > > elements and things like that.
> >
> > > If i was to place them in the request scope would this mean they would
> > > load on every page request? Obs this isnt what i would want.
> >
> > > On Apr 23, 7:23 pm, "Peter Tilbrook" <[EMAIL PROTECTED]> wrote:
> > > > No point. In fact an unnecessary overhead.
> >
> > > > Once the request is finished they are no longer required. Another
> page
> > > > request - they are used - then zip. No locking or anything required.
> >
> > > > Application vars have their place but for - at least how I use them
> -
> > > like
> > > > datasourcenames and such - Request scope is perfectly suitable. Just
> > > declare
> > > > them in the Application.cfm so they are available to all page
> requests.
> >
> > > > --
> > > > Peter Tilbrook
> > > > ColdGen Internet Solutions
> > > > President, ACT and Region ColdFusion Users Group
> > > > PO Box 2247
> > > > Queanbeyan, NSW, 2620
> > > > AUSTRALIA
> >
> > > >http://www.coldgen.com/http://www.actcfug.com/
> >
> > > > Tel: +61-2-6284-2727
> > > > Mob: +61-0432-897-437
> >
> > > > Email: [EMAIL PROTECTED]
> > > > MSN Messenger Live: Desktop General
>
>
> >
>


-- 



Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread M@ Bourke
>So basically, when would you need to be using the request scope?

you never need to use much of anything, it's "when might you use the request
scope" I personally will load querys and stuff into it, that is going to be
accessed for just the page request and be accessed by any files throughout
the request.

M@

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread [EMAIL PROTECTED]

Yeah thanks for that.

So basically, when would you need to be using the request scope?

I use the application.cfc so i would have all this in my
onrequeststart().

Thanks once again guys,

On Apr 23, 7:41 pm, "M@ Bourke" <[EMAIL PROTECTED]>
wrote:
> I'd either put it in your application scope or cache ya query.
> if it's going to be available for every user all the time then application
> shouldn't be a problem
> if the site's busy and ya setting it to request each page request for each
> user then it would be using a lot of memory although the memory would be
> getting cleaned up it would be continually getting filled up.
> I'm not an expert on the inner workings of the cf server but I'd try the
> application scope and if you don't get any issues with it then for this case
> just sick with it.
>
> M@
>
> On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well i store them in the application scope because i call some
> > function to fetch page information from the database and i wouldnt
> > want them to load on every page request, I would much rather store
> > them in the app scope and call them from the pages This was
> > implemented to avoid hitting the db all the time for fetch page
> > elements and things like that.
>
> > If i was to place them in the request scope would this mean they would
> > load on every page request? Obs this isnt what i would want.
>
> > On Apr 23, 7:23 pm, "Peter Tilbrook" <[EMAIL PROTECTED]> wrote:
> > > No point. In fact an unnecessary overhead.
>
> > > Once the request is finished they are no longer required. Another page
> > > request - they are used - then zip. No locking or anything required.
>
> > > Application vars have their place but for - at least how I use them -
> > like
> > > datasourcenames and such - Request scope is perfectly suitable. Just
> > declare
> > > them in the Application.cfm so they are available to all page requests.
>
> > > --
> > > Peter Tilbrook
> > > ColdGen Internet Solutions
> > > President, ACT and Region ColdFusion Users Group
> > > PO Box 2247
> > > Queanbeyan, NSW, 2620
> > > AUSTRALIA
>
> > >http://www.coldgen.com/http://www.actcfug.com/
>
> > > Tel: +61-2-6284-2727
> > > Mob: +61-0432-897-437
>
> > > Email: [EMAIL PROTECTED]
> > > MSN Messenger Live: Desktop General


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread M@ Bourke
I'd either put it in your application scope or cache ya query.
if it's going to be available for every user all the time then application
shouldn't be a problem
if the site's busy and ya setting it to request each page request for each
user then it would be using a lot of memory although the memory would be
getting cleaned up it would be continually getting filled up.
I'm not an expert on the inner workings of the cf server but I'd try the
application scope and if you don't get any issues with it then for this case
just sick with it.

M@

On 4/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Well i store them in the application scope because i call some
> function to fetch page information from the database and i wouldnt
> want them to load on every page request, I would much rather store
> them in the app scope and call them from the pages This was
> implemented to avoid hitting the db all the time for fetch page
> elements and things like that.
>
> If i was to place them in the request scope would this mean they would
> load on every page request? Obs this isnt what i would want.
>
> On Apr 23, 7:23 pm, "Peter Tilbrook" <[EMAIL PROTECTED]> wrote:
> > No point. In fact an unnecessary overhead.
> >
> > Once the request is finished they are no longer required. Another page
> > request - they are used - then zip. No locking or anything required.
> >
> > Application vars have their place but for - at least how I use them -
> like
> > datasourcenames and such - Request scope is perfectly suitable. Just
> declare
> > them in the Application.cfm so they are available to all page requests.
> >
> > --
> > Peter Tilbrook
> > ColdGen Internet Solutions
> > President, ACT and Region ColdFusion Users Group
> > PO Box 2247
> > Queanbeyan, NSW, 2620
> > AUSTRALIA
> >
> > http://www.coldgen.com/http://www.actcfug.com/
> >
> > Tel: +61-2-6284-2727
> > Mob: +61-0432-897-437
> >
> > Email: [EMAIL PROTECTED]
> > MSN Messenger Live: Desktop General
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread [EMAIL PROTECTED]

Well i store them in the application scope because i call some
function to fetch page information from the database and i wouldnt
want them to load on every page request, I would much rather store
them in the app scope and call them from the pages This was
implemented to avoid hitting the db all the time for fetch page
elements and things like that.

If i was to place them in the request scope would this mean they would
load on every page request? Obs this isnt what i would want.

On Apr 23, 7:23 pm, "Peter Tilbrook" <[EMAIL PROTECTED]> wrote:
> No point. In fact an unnecessary overhead.
>
> Once the request is finished they are no longer required. Another page
> request - they are used - then zip. No locking or anything required.
>
> Application vars have their place but for - at least how I use them - like
> datasourcenames and such - Request scope is perfectly suitable. Just declare
> them in the Application.cfm so they are available to all page requests.
>
> --
> Peter Tilbrook
> ColdGen Internet Solutions
> President, ACT and Region ColdFusion Users Group
> PO Box 2247
> Queanbeyan, NSW, 2620
> AUSTRALIA
>
> http://www.coldgen.com/http://www.actcfug.com/
>
> Tel: +61-2-6284-2727
> Mob: +61-0432-897-437
>
> Email: [EMAIL PROTECTED]
> MSN Messenger Live: Desktop General


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Peter Tilbrook
No point. In fact an unnecessary overhead.

Once the request is finished they are no longer required. Another page
request - they are used - then zip. No locking or anything required.

Application vars have their place but for - at least how I use them - like
datasourcenames and such - Request scope is perfectly suitable. Just declare
them in the Application.cfm so they are available to all page requests.

-- 
Peter Tilbrook
ColdGen Internet Solutions
President, ACT and Region ColdFusion Users Group
PO Box 2247
Queanbeyan, NSW, 2620
AUSTRALIA

http://www.coldgen.com/
http://www.actcfug.com/

Tel: +61-2-6284-2727
Mob: +61-0432-897-437

Email: [EMAIL PROTECTED]
MSN Messenger Live: Desktop General

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread [EMAIL PROTECTED]

Would it be better to have these variables in the application scope
over the request scope as they should exist for the entire application
rather than single page request?

This beginning to confuse me even more

On Apr 23, 6:53 pm, "Peter Tilbrook" <[EMAIL PROTECTED]> wrote:
> Request scope variables only exist for the duration of a page request. They
> don't consume RAM like Application variables do. And are ideal for what you
> are using Application vars for.
>
> Best defined in Application.cfm as it is executed before all other
> templates: eg:
>
> 
>
>  setdomaincookies="yes" sessionmanagement="Yes" clientmanagement="yes"
> clientstorage="cookie">
>
> 
> 
> 
> 
> 
> 
> 
>  default="background-color:##ff;">
> 
>
> 
>
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---



[cfaussie] Re: Request VS Application Scope

2007-04-23 Thread Peter Tilbrook
Request scope variables only exist for the duration of a page request. They
don't consume RAM like Application variables do. And are ideal for what you
are using Application vars for.

Best defined in Application.cfm as it is executed before all other
templates: eg:



















--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~--~~~~--~~--~--~---