On Sunday, August 18, 2002, at 03:23 , Brook Davies wrote:
> I have a cf page which calls 4 different cfcomponents using cfinvoke in
> sequential order. Would it be faster to use the inherit property so only 
> 1
> <cfinvoke> command was issued and the one component called the others
> methods? Is this an appropriate use of inheritance?

It sounds like a bad use of inheritance to me and I'm not sure why you 
think it would even solve your problem. Remember that you are invoking 
*methods* not components and that the following two fragments are 
equivalent:

        <cfinvoke component="x" method="f"/>

        <cfobject component="x" action="create" name="temp"/>
        <cfinvoke component="#temp#" method="f"/>

If you are invoking multiple methods in the same component, it will be 
faster to create one instance and use that in each invocation.

You should only use inheritance (extends) if the derived component (the 
one specifying extends=) is a specialization of the base component. By 
which I mean that if you have:

        base.cfc:
        <!--- some base component --->

        derived.cfc:
        <cfcomponent extends="base">
                ...
        </cfcomponent>

Whatever 'derived' and 'base' represent should satisfy the 'derived is-a 
base' relationship, e.g., 'employee' is-a 'person', 'manager' is-a 'role'.

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

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to