I was also going to highly suggest using a factory (or several) to instantiate all your components. When object creation is encapsulated like this, it's easier to swap out most if not all of the paths in your CFC's. If you use Coldspring, then at least some of it will be handled simply by swapping out the XML config file.

Also, if you want to use a type or returntype that simply signifies "a component" ... i would suggest using "WEB-INF.cftags.component" instead of "string" ... as that will make more sense to anyone coming in and looking at the class down the line (including you!). Many people do this.

The advantage to using "any" is that CFAS doesn't check the type each time the function is run. In that sense, type safety in CF is a little ... flaky? Forgetful? Forgetful flaky type safety ...

In CF, there is no such thing as type safety in the sense that all you get is a slightly different error message. CF still allows improperly typed arguments or returntypes to run because "type" is checked at runtime. And in fact, because CF is loosely typed, the components are not really typed in the first place. CFAS simply looks up the metadata recorded in the type or returntype arguments and does a series of tests and lookups against the component's location in the file system, taking into account if it extends another component or not, and either throws an error or not.

So if your primary motivation for typing is type safety ... you might want to re-examine that and see which side of the line you come out on.

If your primary motivation is to document your classes ... well, when i understood what was really going on under the hood, it made more sense to me to put that in the hint tag ... but that's me.

As i understand it, the type issue shifts again in favor if you're using Flex ... but i haven't gotten there yet.

ciao,
Nando


J MacKay wrote:
> Aaron Roberson
> This is a huge problem because it requires that I change the
> path/package name on every object invocation and within every object
> that returns a full qualified path and object name as the return
> type or accepts an argument with the path and object name as the type.

>> Sammy Larbi
>> Also, you may want to use a factory (if it is conceivable, ...

Sammy,

So are you saying remove the path information from the components and let the factory handle it ?

Janet


8:00? 8:25? 8:40? Find a flick in no time
with theYahoo! Search movie showtime shortcut.
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.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



You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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

Reply via email to