Please help me clarify a point in the documentation relating to 'this' and
inheritance. If I can summarise so far:
Variables scope - private instance variables accessible to all methods and
pages included from the component and persists for the life of the object -
all super classes share the same variables scope in any one instance of a
class. 
But what about this? - the documentation states that one cannot use the
'this' scope in super classes - meaning what? Please explain and use the
example below - or better...

If I define (pseudo code):

<component name='A'>
function init() 
{
        this.guid = createUUID();
        _timeCreated = now();
}
</component>

and 

<component name='B' extends='A'>
function init()
{
        super.init();
{
</component>

Sincerely
Hardy

-----Original Message-----
From: Sean A Corfield [mailto:[EMAIL PROTECTED]
Sent: 26 September 2003 00:47
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Top Ten Tips for Developing ColdFusion Components


On Thursday, Sep 25, 2003, at 13:24 US/Pacific, Matt Liotta wrote:
> However, if you provide a way to access data in the variables scope 
> with a "getter" then you have provided a reference to that data right 
> in the variables scope. In my book, if the data private to an object 
> is mutatable then it is not encapsulated.

True - the getter would need to return a copy of the instance data 
(e.g., using duplicate() or something similar) to avoid passing back a 
reference to the 'variables' data. In some cases, passing back a 
reference is fine. It's all about design!

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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 word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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

Reply via email to