Dave:

> Is contact.cfc part of the same application as the Application.cfc
> where the variables are defined?

No, I'm trying to figure out a way to have a common library of cfc's, js,
etc.,
that websites I build can reference.

I saw in other places around the Internet that it's best to keep code logic
outside the webroot. I thought I'd try that.

So, contact.cfc is in
e:\inetpub\common\coldfusion\form-processing\contact.cfc.

The application.cfc is in
e:\inetpub\webroot\hdspa-responsive-dev\application.cfc.

Since application.siteShortDomain is set in application.cfc, when
contact.cfc
is accessed via AJAX, contact.cfc has no knowledge of the
application.siteShortDomain
variable.

Just trying to figure out how to make contact.cfc aware of the value of
application.siteShortDomain.

Rick


On Tue, Jun 25, 2013 at 12:04 PM, Dave Watts <dwa...@figleaf.com> wrote:

>
> > 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:356055
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to