Perhaps 'odd' is the wrong term.  It's ambigious.  I.e. does
"component" mean "component name/path", or does it mean "component
instance"?  Leaving that ambiguity is an odd design choice to me.  It
seems much less confusing to have two distinct attributes, be they
name/object, path/instance, or something else.  Take, for example,
this code:

<cfset application.pathToCfcs = "monkey.dir.path.neat" />
<cfset application.service = "#application.pathToCfcs#.serviceimpl" />

<cfinvoke component="#application.service#" method="doSomething" />

Static invocation on the doSomething method of the CFC
monkey.dir.path.neat.serviceimpl.  Now how about this (identical final
line):

<cfset appliation.service = application.factory.getBean("beanName") />

<cfinvoke component="#application.service#" method="doSomething" />

Stateful invocation of the doSomething method of the CFC instance
#application.service#.

Of course, I wouldn't generally recommend setting up your application
with fully dynamic paths like this, of course, but I've done it this
way where I needed to base parts of the path names on runtime-provided
configuration options.  I use CFSET not CFINVOKE so there wan't a
problem, but if you prefer CFINVOKE, there's some lurking "nasty".

cheers,
barneyb

On 9/14/06, Raymond Camden <[EMAIL PROTECTED]> wrote:
> I don't think it's odd per se. One way lets you use an object you may
> not have an instance of:
>
> component="foo"
>
> and one lets you use an instance, which you may want to do for
> performance or data reasons
>
> component="#foo#"

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253163
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to