ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 5th, 2005, 01:30 AM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 37 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 8 sec
Reputation Power: 5
Red face CF 7 ++ variable name resolution question

Hi,

Currently in some of my code, I do not explicitly define the variable's scope. Especially when it comes to url.x and form.x

I know it's better to do so, but it makes life easier sometimes when I can use the same processing page and call it in different ways from different places on my site. It's highly effective that way.

My question is does CF 7 support name resolution (as in it figures out the scope by itself for form and url scoped variables)? And more importantly, is there any news regarding removing such support in future CF products?

Prem
__________________
We can help export your products http://www.GIAgroup.com/

Reply With Quote
  #2  
Old August 5th, 2005, 08:21 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
CF will always do a scope lookup if it cannot find the variable in the variables scope. I highly doubt this will ever change...it's been like that since I can remember (version 3.0), and backwards compatibility is always a high priority.

The reuse of code you mention is exactly why the Fusebox framework moves all form and URL variables into the attributes scope, so that you never need to know if the data came from a form vs. a URL value. The more OO frameworks such as Model-Glue and Mach-II actually create event objects and viewState objects which completely encapsulate these variables into CFC instances that are passed around as page processing is done.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old August 8th, 2005, 12:39 AM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 37 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 8 sec
Reputation Power: 5
I totally understand what you're saying. Thanks for the info. Fusebox has been around for a while but unfortunately I've never had the time to dig into it. Maybe some day soon I should get my hands dirty. :-P

Prem

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > CF 7 ++ variable name resolution question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT