|
Factories are definitely a big help here, but the returntype and type
arguments still need to be hardcoded. If you can live with all your CFC's being in a single directory, you can, with a Factory in the same directory, use the Factory to instantiate all your cfcs and use just the CFC name alone in the returntype and type arguments. You instantiate your Factory as a singleton in application scope from Application.cfc/m using a reference to the directory where your CFC's are stored, and call your factory from everywhere else in your application anytime you need a CFC instance. As long as the directory path between Application.cfc/m and your CFC directory remains consistent, i believe you can port that architecture anywhere. Peter Bell wrote: I haven't seen anyone comment on the dev and live components. This is what factories are for - so you can abstract implementation details like paths from your calling templates. I rteally haven't played with it, but a dependency injection engine like ColdSpring should allow you to do this kind of conditional metadata at runtime (someone with ColdSpring experience please correct me if I'm wrong!). If not, you do it yourself by creating an object factory and putting the conditional logic in there "if Devmode then ComponentBasePath = com.dev"Best Wishes, Peter -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of dickbob Sent: Thursday, March 16, 2006 5:43 AM To: [email protected] Subject: Re: [CFCDev] How to use returntype correctly Hi Tom, Thanks for your comments... |
- Re: [CFCDev] How to use returntype corr... Mark Mandel
- Re: [CFCDev] How to use returntype... Cliff Meyers
- Re: [CFCDev] How to use return... Dave Carabetta
- Re: [CFCDev] How to use return... Jason Daiger
- Re: [CFCDev] How to use return... Dave Carabetta
- Re: [CFCDev] How to use return... Nando
- Re: [CFCDev] How to use return... Dave Carabetta
- Re: [CFCDev] How to use return... Jason Daiger
- Re: [CFCDev] How to use return... Patrick McElhaney
- Re: [CFCDev] How to use return... Dave Carabetta
- Re: [CFCDev] How to use returntype correctl... Nando
- Re: [CFCDev] How to use returntype correctl... Thomas Chiverton
- [CFCDev] OT: Sending Files to Browsers Brent Nicholas
- RE: [CFCDev] OT: Sending Files to ... Roland Collins
- Re: [CFCDev] How to use returntype correctly Haikal Saadh
- Re: [CFCDev] How to use returntype correctly Salvatore Fusto
- Re: [CFCDev] How to use returntype correctly dickbob
- RE: [CFCDev] How to use returntype correctly Nolan Erck

