I agree with Jarod. Without ColdSpring, I would say that constructor
injection is preferred. However, since ColdSpring won't give you back an
object to use until all the dependencies have been resolved, there is no
danger of getting an "incomplete" object. I favor the setter injection since
one never knows when a circular dependency will pop up in the future, so
just going with setter injection to begin with can save some rework down the
line.


On 7/9/07, Jared Rypka-Hauer <[EMAIL PROTECTED]> wrote:

There's also constructor-injection, which passes anything defined in
<constructor-arg /> tags to the init() method of the CFC (or whatever you've
defined as your constructor) the same as things are passed to <property />
tags, only at instantiation time, not after instantiation.
I used to strongly favor constructor injection... lately I've swung over
to property injection unless there's a compelling reason to do otherwise.


J


------------------------------------------------

Jared C. Rypka-Hauer

Continuum Media Group LLC

http://www.web-relevant.com



Reply via email to