On Fri, 2007-05-04 at 18:53 -0700, Tatu Saloranta wrote: > --- Roland Weber <[EMAIL PROTECTED]> wrote: > > > Hi Oleg, > > > > > * Made the default HttpClient implementation more > > DI frameworks > > > friendly. Most dependencies (barring the client > > connection manager) can > > > now be in injected through a setter. > > > > I consider reliance on setters rather than > > constructors as a > > limitation of the DI framework. Anyway, I have no > > For what it's worth, major DI frameworks can deal with > constructor-based dependency injection pretty decently > (my experience is mostly with Spring, which has no > problem with this). > > -+ Tatu +- > >
Roland, Tatu I have a fairly simple rule to deal with the problem: inject requisite dependencies for which no reasonable default impl can be created through a constructor, optional dependencies - through setters. With a few notable exceptions this approach works well for me. In case of HttpClient only connection manager is a requisite dependency. For all others we can simply create an instance of the default impl class if the dependency has not been injected by the consumer. Oleg > > > > ____________________________________________________________________________________ > We won't tell. Get more on shows you hate to love > (and love to hate): Yahoo! TV's Guilty Pleasures list. > http://tv.yahoo.com/collections/265 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
