On Wed, May 12, 2010 at 2:43 PM, Les Hazlewood <lhazlew...@apache.org> wrote:
> Agreed.  And after working with all these getters/setters and trying
> to figure out when it is safe to initialize things or not, I would
> _REALLY_ love to use constructor injection for everything.
> Unfortunately, for whatever reason or another, a lot of people seem to
> really dislike using it :/

They just haven't seen the light yet :)

> I guess its because there are scenarios where constructor injection
> probably wouldn't be pleasant - think of how many permutations of
> config options there are for dependency injection.  It seems like that
> could get really ugly.  I don't know for sure, as I've been using
> Spring property injection for some time and only rarely constructor
> injection - they allowed me to be lazy in that regard :/

Right.. in this specific case a constructor collection and an add
operation would be the best choice from Guice/Tapestry 5 perspective
but then you'd really need to use either of those IoC containers to
implement it properly. And there's no point re-working the internals
now - this works and at least, like you said, it's consistent
throughout.

Kalle

Reply via email to