If the CFCs are related, why not use the same directory? Ie

/root
/root/wwwroot (web files here)
/root/cfcs

If your app was Foo.com, you could make a mapping that points to root,
then all your cfcs would have the path:

foo.cfc.whatever

And of course, if whatever needs to access whoever in the same package,
it can just call "whoever". 

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Shawn Grover [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 12, 2003 4:32 PM
> To: CF-Talk
> Subject: How do you pass the location of your CFCs to other CFCs?
> 
> 
> We are trying to follow good OO coding standards as we 
> develop our CFCs, but have hit a minor snag.
> 
> Basically, an action page will call a business rule 
> component.  But first, it needs to know where we've stored 
> the components.  That's fine, I can set a variable in 
> Application.cfm.  Now the business rule component may have 
> need to access other components (other BR or data access 
> components), I can hard code the path to the components 
> during development, but it'd be VERY nice if I didn't have to 
> replace these values when the project is delivered (different 
> server and base directory) or we moved our development 
> server. How do YOU handle this?
> 
> We've toyed with the idea of using a central configuration 
> object which all objects could instantiate if needed, but 
> then how does the CFC know where the config.cfc is?  Next, we 
> considered specifying a variable in the Request scope, but 
> this means the components MUST know something about the 
> environement they are being used in, which breaks OO coding 
> standards (think black box).  So, the only other option we 
> can think off is to pass the path to the objects, either on a 
> per function basis, or through an "init" function right after 
> the component is created.  This option is probably the most 
> robust overall, but means revising a number of components 
> that already exist.  So, I'm thinking that leaves us with the 
> Request scope variable. Are there any other options we're 
> missing?  (reading from a file presents the same problem - 
> how does the cfc know where the file is located without 
> breaking OO standards?).
> 
> Thanks for any input/suggestions.
> 
> Shawn 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

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

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to