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...

  
How do I reconcile the fact that the pathname must be a constant 
value with the path being different between the dev and live 
environments?
      
You mean you have objects like
com.wibble.fo.bar
on live but something different in development ? Why ?
    

Not all of us have the luxury of a different dev and live server so I
have...

com.dev.wibble.fo.bar

...and...

com.live.wibble.fo.bar

...for the two different code streams.

Dickbob




----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]





----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]



  


--


Aria Media Sagl
CP 234
6934 Bioggio
Switzerland
www.aria-media.com


Reply via email to