|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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/ |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CF 7 ++ variable name resolution question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|