If you're calling an inherited method from within a subtype, then that sounds like normal behavior. Subtypes inherit the methods of the Supertype and they are treated as local methods, so if you have a Super with method A, a Subtype with method B, and method A makes a call to method B, there shouldn't be an error if the object you're using is an instance of the Subtype. However, if you ever instantiate the Super and try calling that method, you should get an error.

In other words, it's a potentially dangerous situation that's only working because of the circumstances in which it's being used. I'd recommend finding another way to get that value into method A. :)

On Nov 11, 2004, at 1:50 PM, Nando wrote:

The scenario is that i'm calling a function in the supertype, and the
supertype needs a value that the subtype has to do what it needs to do.

I could either call the subtype's getter for that value and pass it in, or,
as i just noticed, declare the getter in the subtype for that value public
and call the getter directly from the supertype. But that seemed "off" - and
i can't tell from my lack of experience if it's a CF implementation quirk or
perfectly fine to do it that way ... Perhaps i could create a wrapper
function in the subtype, get the value and pass it into the super.




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Ken Ingle
Sent: Thursday, November 11, 2004 7:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Sanity check


You would not want to call the child object from the parent object. The child extends the parent, so when you call the child you will automatically have all of the parents capabilities available.

I can't think of any reason you would want a parent calling a child
from the parent.  Does that make sense?

Ken Ingle
[EMAIL PROTECTED]
http://www.kicweb.com/blog
I have 3 Gmail Invites Left, email me for one.


On Thu, 11 Nov 2004 19:14:41 +0100, Nando <[EMAIL PROTECTED]> wrote:
Hi all,

I'm just noticing that if i declare a function as public in a subtype, i
can
call it from within it's supertype in CF. At least that's what i think i'm
seeing.


Is that the way it "should be"? Sorry, i just have a few grey areas here
that i'm trying to fill in from my lack of OO experience.


I haven't had time to create a test case yet to isolate this, i'm on a
deadline for tomorrow morning, but the strange thing is i don't get an
error
if the function in the subtype is private, like you would from outside the
object. It seems to just get ignored.


???

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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
[EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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
[EMAIL PROTECTED]



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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 [EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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 [EMAIL PROTECTED]

Reply via email to