> If I have an object loaded in the Application scope and want to use it in
> another object/component ,should I pass it in as a variable or should I
> call
> it directly from the Application scope. Assume that the object will always
> be loaded in memory.
> 
> TIA
> G

I would advise against accessing the component directly.  As a general rule,
you should not have any CFC access a scope outside of itself.  I would
suggest one of the following two approaches: 

1. Use a façade to the application scope
By using a façade, only one component is tied directly to the application
scope.

2. Injection
Using either constructor or setter injection, pass the object in as a
variable.

HTH,
Rich Kroll


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

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

Reply via email to