Could someone help me understand component extension?
I've read a couple chapters over on component extension (use of the EXTENDS attribute in a CFCOMPONENT tag) but something isn't clicking; so I'm looking to the forums for some supplemental info that'll help me have a eureka moment and comprehend.
As a preface, I have, what I would call, an intermediate knowledge of CF (working towards advanced). So if we can keep the explanations into as much Layman's terms as possible, that would be appreciated and most helpful. ![]()
To my knowledge, if you have a component, you can make its THIS-scope variables and its methods available to other components if those components have an EXTENDS attribute in their CFCOMPONENT tag that uses a fully-qualified dot notation path to the "extended-from" component.
I tried to put this into practice by having a master.cfc and slave.cfc The master is located off the root in a folder called 'www'. The slave is located off the root in at the location: 'www/app/coms'. So in the slave.cfc component I wrote:
<cfcomponent extends="www.master" ...
Assuming that it was the same as CF starting from the root of the website and looking into the www folder and then seeing the master.cfc.
But when I have the slave component call a function that exists in the master, it says it cannot find it. What am I not getting here? This sounds like a POWERFUL way to share the application.cfc's THIS-scope variables, so I'd like to comprehend this ability, but there's something I'm missing it seems.
