right, if I need only one of foo.cfc inside MyUberCFC.  But in this case I may need to create 0 - n instances of foo.cfc inside MyUberCFC.

DK

On 8/30/06, Matt Williams <[EMAIL PROTECTED]> wrote:
ColdSpring can autowire the beans together.
You register the MyUberCFC.cfc in the CS config file also and tell CS
to get an instance of foo

<bean id="MyUberCFC" class="cfcs.MyUberCFC">
  <property name="foo">
    <ref bean="foo">
  </property>
</bean>

Then your MyUberCFC needs a setter function...
<cffunction name="setFoo" ...>
  <cfargument name="Foo" ...>
  <cfset variables.Foo = arguments.Foo >
</cffunction>

Then any other function in MyUberCFC can access Foo's methods via
variables.Foo.doSomething ()

On 8/30/06, Douglas Knudsen <[EMAIL PROTECTED]> wrote:
> ok you coldspringers!  Say I'm using ColdSpring and have it all setup and
> running.  I have the CFC foo.cfc registerd as a bean in teh coldspring.xml
> file.  Now I create a new CFC called say MyUberCFC.cfc.  Inside this CFC I
> need to create a instance of foo.cfc.  Is it best practise to use the
> coldspring factory here?  ie should I use
>
> <cfset myInstance =
> application.serviceFactory.getBean('foo') />
>
> or just use
>
> <cfset myInstance = CreateObject('component',' path.to.foo') />
>
> or maybe I should have a application facade CFC in use?
>
> --
> Douglas Knudsen
> http://www.cubicleman.com
> this is my signature, like it?


--
Matt Williams
"It's the question that drives us."




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?

Reply via email to