In a related thing to what barney does is decorating (composition) of CFC's and 
drilling down into this extra CFC


in the init() of "myObject"

        <cfset this.entityService = createObject("component", "entity.service") 
/>
        <cfreturn this />

that way I can get to the "decorating" CFC by

<cfset myObject.entityService.doSomething() /> 

but to be honest, I rarely need to do this...

my 2c
barry.b


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Barney Boisvert
> Sent: Wednesday, 25 May 2005 8:45 AM
> To: [email protected]
> Subject: Re: [CFCDev] when is "this" appropriate
> 
> 
> The only time I ever use 'this' in CFCs is <cfreturn this /> in my
> init() method.  If you need public variables (which is usually a
> questionable practice), that's another place to use it, but other than
> that, you shouldn't ever need the 'this' psuedo-scope.  All your
> private instance data should be in the 'variables' scope (or
> variables.my, variables.instance, etc.).
> 
> cheers,
> barneyb
> 
> On 5/24/05, Paul Roe <[EMAIL PROTECTED]> wrote:
> > So when is it appropriate to use the 'this' ope rater when 
> dealing with cfc's?
> > 
> > It was always easy to figure out in java because it either worked or
> > it didn't. Now with cf I'm finding myself writing inconsistent code
> > because I don't have a good enough understanding of when you should
> > and shouldn't use 'this'. Any suggestions about reading materials or
> > just any general standards advice would be appreciated.
> > 
> > Thanks in advance
> > 
> 
> -- 
> Barney Boisvert
> [EMAIL PROTECTED]
> 360.319.6145
> http://www.barneyb.com/
> 
> Got Gmail? I have 50 invites.
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email 
> to [email protected] with the words 'unsubscribe cfcdev' as 
> the subject of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by 
> CFXHosting (www.cfxhosting.com).
> 
> CFCDev is supported by New Atlanta, makers of BlueDragon
> http://www.newatlanta.com/products/bluedragon/index.cfm
> 
> An archive of the CFCDev list is available at 
> www.mail-archive.com/[email protected]
> 
> 
> 


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to