> However, the "contact.cfc" has to reference variables setup in the
> application.cfc, which exists inside the website root. Unless I place
> the application.cfc in the same folder as "contact.cfc", it doesn't work.
>
> So, how do I make the variables from application.cfc available to
> contact.cfc under such a scenario? Does the "extends" functionality of
> cfc's solve this? Is that what I need to understand and implement or do
> I need to look into something else?

Is contact.cfc part of the same application as the Application.cfc
where the variables are defined? If so, why aren't those variables
just part of the Application scope, instead of local variables that
get recreated for each page request?

Code reuse is very important. But code reuse doesn't just mean "invoke
one module from another one". It requires that you structure your code
appropriately in the first place. I'm not seeing that structure from
your description - that doesn't mean there isn't any structure, just
that I'm not seeing it in your description.

In general, you don't want to use Application.cfc as the parent class
for any other class except another Application.cfc - for example, in a
subdirectory of the parent application. You don't want to use it as
the parent class for other CFCs.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356051
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to