Thanks to all who replied to my posting. I'd like to summarise my reply:

> salvatore wrote: 
> I suggest reading hal helms articles about strong and dinamic typing

Yes, tried to read that. Bit over my head but I'll try again.

> Mihai wrote: 
> The "luxury" of different dev and live servers is a poor excuse
> for not downloading the coldfusion developer edition ...

I didn't too much offence to my excuse, but I do have my reasons.

> Peter wrote:
> I really haven't played with it, but a
> dependency injection engine like ColdSpring should allow you to do this kind
> of conditional metadata at runtime

Another for my research list.

> Cliff wrote:
> Alternatively you can just put the component name in the cfargument
> type attribute or cffunction returntype attribute.  So instead of
> "com.company.app.User" you could just list "User" instead.

This is what I've been trying up till now. Just try to find a compelling
reason to go to the next level of full pathnames.

>Nando wrote:
> 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.

Another to research, Factories and singletons.

>Dave wrote:
> Due to the requirements of accessing CFCs in Flex 2, I would use the
> fully qualified path rather than the abbreviated name if you even
> *think* you might use Flex 2. This way, you're more forward-thinking
> and reduce any potential headaches down the road.

A good justification for full pathnames if Flex 2 is s long-term objective.

Thanks again to all how contributed.

dickbob


> From: dickbob <[EMAIL PROTECTED]>
> Reply-To: <[email protected]>
> Date: Thu, 16 Mar 2006 10:09:37 +0000
> To: "[email protected]" <[email protected]>
> Conversation: How to use returntype correctly
> Subject: [CFCDev] How to use returntype correctly
> 
> Hi,
> 
> I've been using cfc's for a while now and all's fine, but I want to improve
> my techniques so that I use them correctly.
> 
> My questions are about the returntype attribute to CFFUNCTION and the type
> attribute in CFARGUMENT.
> 
> Now I'm happy with using "string", "xml", "query" etc for functions that
> return a value. What I'm unsure about is when I specify a returntype for the
> component name and use that also as the type in CFARGUMENT.
> 
> What are the benefits? All seems to work okay without them.
> 
> Do I need to give the full pathname to the component? Why?
> 
> 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?
> 
> TIA,
> 
> 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]


Reply via email to