Jim, So lets say I have code at the top of every page in my application that checks for the existence of certain session variables and if it doesn't find them redirects the user to a login page.
You're saying that I could define this once in application.cfc and set the behavior for the entire application? Tthis could be a huge timesaver for me in building portals. Rick Mason On Sat, 12 Mar 2005 00:55:58 -0500, Jim Davis <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > > From: Tony Weeg [mailto:[EMAIL PROTECTED] > > Sent: Friday, March 11, 2005 11:59 PM > > To: CF-Talk > > Subject: Re: Application.cfc - why? what's it for? > > > > glad you asked mike. > > > > i've been wondering the same! > > Take this with a grain of salt since I've not started using it myself but... > > In short all Application.cfc offers you is (some relatively basic) event > handling (specifically application, session, and request start and end > events). > > In other words in the Application.cfc you can say "I want this to happen > when a session starts and this to happen when a session ends" (same for the > application and request). > > Many of us have home grown systems to do this in earlier versions, but this > is infinitely simpler. > > Since CF manages the calls to the methods you're code ends up being much, > much cleaner if you were used to doing this stuff yourself. Ever see code > like the following: > > <cfif IsDefined("Application.Init")> > ... Do a bunch of App set up ... > <cfset Application.Init = true> > </cfif> > > I thought so - that code is completely unnecessary with application.cfc: CF > "knows" when the first request to an application is made and it calls the > application start method for you. No checking, no clutter: you (in theory!) > can rest assured that all the code in that method has been run. > > Same for sessions and requests - these, in particular where huge pains in > the ass in previous versions. Now you just create a few methods that CF > calls automatically. > > It doesn't really do anything else: that's it. Nice, simple and elegant (at > least I think so). > > As I said - I might be way off here, but that's the way I understand it. > > Jim Davis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198545 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54