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 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4