>
> I think you're starting to see where ColdSpring (or Lightwire) might
> come in handy :)


I second that - spend 30 mins getting a very basic ColdSpring setup running;
you won't look back, it is a beautiful answer to this question.

ColdSpring uses an XML file as a configuration for all your 'beans', here's
a very rough example, reusing a component by passing it as an argument to
another:


<bean id="datasource" class="myApp.model.dao._datasource" singleton="true">
  <constructor-arg name="name"><value>MyDS</value></constructor-arg>
</bean>

<bean id="SomeDao" class="myApp.model.dao.someDao" singleton="false">
 <constructor-arg name="datasource">
   <ref bean="datasource"/>
 </constructor-arg>
</bean>
Then, with coldspring up and running you might do in your app:

<cfset someDaoInstance = coldSpring.GetBean("SomeDao")>

Hope that makes you curious. If you are looking for best design practice,
the answer to your OP is to NEVER reference variables outside the scope of
your component, pass it in as a variable as your instinct tells you ;)

Dominic
-- 
Blog it up: http://fusion.dominicwatson.co.uk


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:300589
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