#1 I am a fan of DI and agree about the hard way of selling it. My reasoning for DI is tests. *Tests help us to prevent regression, clarify requirements with clients (BDD) and act as documentation. In order to write some tests we need to inject a dummy. How do we inject a dummy? --> DI*
#2 I am not a big fan of IoC containers either. I have similar experiences as Justin documented here (although the setup of dependencies can become messy without IoCC) http://codelikebozo.com/breaking-up-with-ioc .peter.gfader. (current mood = happy) http://blog.gfader.com On Thu, Oct 27, 2011 at 10:05 AM, <[email protected]> wrote: > ** I don't buy the cheaper maintence costs argument, the 5 projects that > I am supporting all use spring for DI. > I spend half of my time trying to figure out how the damn thing is > configured. > > Although a code based injector without xml config files at least alows you > to debug the code and see what is missing. > > I like DI, but it sure doesn't save time. > > Davy > > "When all you have is a hammer, every problem looks like a nail." I feel > much the same way about xml > ------------------------------ > *From: * mike smith <[email protected]> > *Sender: * [email protected] > *Date: *Thu, 27 Oct 2011 16:46:45 +1100 > *To: *ozDotNet<[email protected]> > *ReplyTo: * ozDotNet <[email protected]> > *Subject: *Re: Other developers don't like dependency injection > > On Thu, Oct 27, 2011 at 3:00 PM, Nathan Schultz <[email protected]>wrote: > >> I'd probably sell it differently. >> >> Instead of saying you "don't know" where the objects come from, say that >> objects come from a centrally configured location (since in practice the >> objects are usually defined in configuration, or in bootstrap code). >> >> And sell cheaper maintenance costs (modular design, easy to refactor, >> easy to replace components, easier to extend, fewer system wide bugs, helps >> with a cleaner implementation, less spaghetti code, etc). >> >> To get it past some of the "old hats" here I temporarily changed >> terminology. Dependency Injection (let alone IoC) would draw blank looks, >> but say "plug-in system", and they've all rolled one before and are >> comfortable with the concept. >> >> >> > Also, it sounds like those baddies, DLL Injection & SQL Injection. Make > it sound different, and you could get a better reaction. > > > -- > Meski > > http://courteous.ly/aAOZcv > > "Going to Starbucks for coffee is like going to prison for sex. Sure, > you'll get it, but it's going to be rough" - Adam Hills > > -- .peter.gfader. Current mood = happy! Check this before you go live http://blog.gfader.com/2011/07/website-check-list-part-1-aspnet-4.html
