That's cool. I was just wondering the best way to go about calling them,
because data wise, a content record must exist before I create the file
record... I'll put little examples below:

someinvokingpage.cfm

<!--- create a reference to the object (it inherits the content
component too) --->
request.oFile = createobject("component", "system.api.file");
stContent = request.oFile.addContent(some args);
stFile = request.oFile.addFile(some args);

Is that the best way to do it? Or, should the file components addFile()
method call addContent() like so.

file.cfc
<cfcomponent displayname="file" extends="content">
        blah...
        blah...
        <cffunction name="addFile" access="public" returntype="struct">
                <!--- 
                some arguments
                --->
                <cfset stConent = addContent(some args)>
                <!--- 
                now do your own thing
                --->
..

If I went this route, wouldn't the file component's addFile() method
require the content component's arguments as well as it's own?

Thanks for your help.

Phillip






-----Original Message-----
From: Stacy Young [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, June 26, 2002 11:12 PM
To: CF-Talk
Subject: RE: calling inherited methods


If you have a file component that inherits the content component you can
call any instantiate the file component alone and call any method in
either of the two components...

That help?

-----Original Message-----
From: Phillip Cave [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, June 26, 2002 10:24 PM
To: CF-Talk
Subject: calling inherited methods

what is the best practice when calling inherited methods? say i have
basic 'content' component with a addContent() method. I also have a
'file' component that inherits the content component. what is the best
way of adding a file. 

Would I...

1. call the inherited addContent() method then the addFile() method from
a page that invokes the 'file' component. 2. have the addFile() method
of the 'file' component call the addContent() method. this would mean
that my addFile() method would require the addContent arguments as well
as it's own. 3. or have a generic add() method in both components. would
the 'file' add() method overwrite the 'content' add() method?

which way is best, or is there some other ways i'm not thinking of?

thanks!

phillip         



______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to