hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [HttpClient] HttpClient 4.0 progress report
Date Sat, 05 May 2007 09:55:57 GMT
On Fri, 2007-05-04 at 18:53 -0700, Tatu Saloranta wrote:
> --- Roland Weber <ossfwot@dubioso.net> 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message