Sample use of "depends" in CFCs

0 views
Skip to first unread message

<jorge_loyo>

unread,
May 12, 2008, 11:29:04 PM5/12/08
to Mach-II for ColdFusion
What is the difference between injecting beans with CS and using the
new "depends" attribute for automatically wire beans.

Is there some sample code?

I currently write the get/set methods in my listeners and have
ColdspringProperty resolve Mach-II dependencies.

Does the new "depends" attribute removes the necessity to write the
get/set methods myself?

Thanks for helping me with this one :-)

<jorge_loyo>

unread,
May 12, 2008, 11:47:19 PM5/12/08
to Mach-II for ColdFusion
From what I understand from the presentation, I could reference a
"getUtils()" method that doesn't actually exists in the listener as
long as I include depends="Utils" in a CFC that extends the framework.

Is this correct? If so, is the ColdSpringProperty parameter to resolve
Mach-II dependencies needed?

Peter J. Farrell

unread,
May 13, 2008, 2:37:34 AM5/13/08
to mach-ii-for...@googlegroups.com
You need to use the MachII.properties.ColdspringProperty in 1.6. Define all beans you want from CS in the depends attribute in your cfcomponent tag. Depends takes a comma delimited list of bean names. You do not need to define any setters/getters as the CS property atuomagically creates and injects them for you via mixins. This works on framework level components only (I.e. Listeners, filters) and cannot be used on beans managed by CS as this is not a CS feature but unique to our CS loader.

HTH,
.Peter
-----Original Message-----
From: "<jorge_loyo>" <jorgeloyo...@gmail.com>

Date: Mon, 12 May 2008 20:47:19
To:Mach-II for ColdFusion <mach-ii-for...@googlegroups.com>
Subject: [Mach-II] Re: Sample use of "depends" in CFCs

Jorge Loyo

unread,
May 13, 2008, 11:31:06 AM5/13/08
to Mach-II for ColdFusion
Nice... Smaller listeners AND if I change location of the CFCs that my
listeners are injected with I don't have to freak out about changing
the path to the getter/setter methods with a massive find/replace.

Very nice...
Reply all
Reply to author
Forward
0 new messages