Yep... for every component, there's at least 3 scopes:
variables
this
super

When you call createObject("component","foo.path.to.my.Component"),  
you're having ColdFusion create you an instance of a component and it  
has it's very own set of scopes. In order to give it access to share  
data between scopes you have to code it to get data from any other  
scope, or any other component.

When you are writing a cffunction you have to consider two other  
scopes as well. Function-local scope and the arguments scope. Inside  
every component function, be sure to use the var keyword i.e. <cfset  
var someFoo = "foo"/> so that your variable will exist in the  
function-local scope (or you could just use the arguments scope,  
which I often do). If you don't, your variables will get put into the  
variables scope instead of being cleared out and reused as available  
memory after the function finishes executing.

J

On Nov 13, 2008, at 5:19 PM, Brian Kotek wrote:

> Every component instance has it's own data that is separate from  
> other instances.
>
> On Thu, Nov 13, 2008 at 4:40 PM, [EMAIL PROTECTED]  
> <[EMAIL PROTECTED]> wrote:
>
> I scoped a component on Application level.
>
> Now i have others components in application that i extended from that
> component (that i defined in application level).  so if i will be
> retriving the methods or data in my child classes from methods of
> application scope component.  so what will be the output.  it will
> give me data from application scoped componenet or each time my child
> class will intilizes a new componenet.
>
> ---I mean to say my child classes get extended from application scoped
> componenet or it get extended by new parent componenet?  ---

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to