Autowiring in CB 3 M5

Im starting to play around / work with CB 3 M5 and i am really excited
about the new module-features!

Now i have a question about autowiring:

After activating the Autowire-interceptor in CB-Config, do i still have to
declare autowire="true" at the cfcomponent-tag of a Handler or a Service-Object
to use cfproperty-injection?

<cfcomponent name="handler" output="false" autowire="true">
or
<cfcomponent name="srvObj" output="false" autowire="true" singleton="true">

Regards,
Daniel

lists@platform.ch

autowire annotation is no longer necessary for any wiring in 3.0, it is implied.

If you deactivate the interceptor, then no autowire.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

This concerns me a little so I hope I'm misreading you: is there a way
to turn autowiring off completely in ColdBox?

Previously, the autowire attribute provided this control and we took
advantage of that to use only ColdSpring for management of our beans.
How can we move to M5 and ensure that we still have control over
autowiring?

Same deal Sean, the autowire interceptor has a flag: annotationCheck. Which gives you what you want.

So you can either have it implied, which is the default, or turn it on, to enable targeted autowiring, which is what you want. Phew!! Best of both worlds!

:slight_smile:

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Also, the autowire interceptor only autowires: plugins, handlers, interceptors and if directed (ORM entities via the ORM evnet handlers). It does NOT autowire domain objects.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Just confirmed with Luis off-list: this means that moving code that
does *not* currently use autowiring from M4 to M5 will *require* the
addition of annotationCheck="on" to the autowire interceptor in order
to avoid strange interactions. Just something to be aware of.

Presumably I could just comment out the Autowire interceptor
declaration altogether? Since we're not using autowiring, I probably
ought to do that in preparation...

Sean

I went ahead and did that and our battery of tests still pass (and run
slightly faster - since the tests effectively reload CB fairly often
:slight_smile: