Dependency Injection and Inversion of Control are not rocket surgery

Updated 3 months, 2 weeks ago

Source: http://www.lazycoder.com/

I see a lot of people talking about how “advanced” techniques like dependency injection and inversion of control are and how their team won’t understand either technique.

 

Folks, this isn’t hard. In fact, both of these things are so simple I simply call it “using the programming language”.

 

Let’s look at dependency injection.

PLAIN TEXT

CODE:

public class MyClass

{

private DataTableReader _reader;

...

  • 28 comments on this story
PRO

50% positive

Showing 12 relevant reactions out of 28.

Good IOC/Dependency Injection explanation... http://tr.im/El5x

4 months, 2 weeks ago by jason_gleason on Twitter

Great example. I have bookmarked this and will use it to show my colleagues just how simple DI and IOC are.

4 months, 2 weeks ago by Garry Pilkington on Wordpress

[...] This post was mentioned on Twitter by Scott Koon, Ryan Farley, Jungchan Hsieh, Patrick Veverka, Doug Philips and others. Doug Philips said: RT @lazycoder: [posted]Dependency Injection and Inversion of Control are not rocket surgery http://bit.ly/1AjGZN [...]

4 months, 2 weeks ago by Tweets that mention Dependency Injection and Inversion of Control are not rocket surgery | Lazycoder -- Topsy.com on Wordpress

Simple and to the point of what I'm doing a lot these days (refactoring code) http://bit.ly/1c1QF

4 months, 2 weeks ago by robcube on Twitter

[...] Dependency Injection and Inversion of Control are not rocket surgery (Scott Koon) [...]

4 months, 2 weeks ago by Dew Drop – November 4, 2009 | Alvin Ashcraft's Morning Dew on Wordpress

[...] Dependency Injection and Inversion of Control are not rocket surgery – Scott Koon shows how the techniques of Dependency Injection and Inversion of control are not as complicated as may developers believe, looking at definitions of the techniques and showing simple examples of both. [...]

4 months, 2 weeks ago by Reflective Perspective - Chris Alcock » The Morning Brew #469 on Wordpress

That’s probably the best description of these concepts I’ve seen.

I have to be honest, I was fairly confused by DI and IoC the first time I saw them. I wish I’d seen an article like this right at the start – it would have made things a lot easier.

Thanks, I’ll be passing this link on.

4 months, 2 weeks ago by Damian Brady on Wordpress

In a word – “Quality!”

It’s posts like these that are driving home everyday something that we already know: these concepts are not tough to understand and use, it is the incessant resistance to change causing problems.

The more of these great 1-pagers we have in evidence, the more I get to point out to those whining about “if it ain’t broke…blah”
... See all content

4 months, 2 weeks ago by Rob G on Wordpress

Wim: Yeah, I struggled a bit to come up with a good example of IoC. I finally just went with the interface injection. I supposed that delegate event handlers would have been another good example, one that might have turned on the light bulb for a lot of people. “Oh, I’m already using IoC and I didn’t even know it”.

4 months, 2 weeks ago by Scott on Wordpress

Social comments and analytics for this post…

This post was mentioned on Twitter by lazycoder: [posted]Dependency Injection and Inversion of Control are not rocket surgery http://bit.ly/1AjGZN…

4 months, 2 weeks ago by uberVU - social comments on Wordpress

Dependency injection really is something that enables inversion of control. It doesn’t have to be the case. In your reader example IoC isn’t very clear at all.

In my opinion IoC is more about having a container that really controls a fairly granular set of methods defined on the dependency interface definition but the container wraps its own logic, logging, and process of executing
... See all content

4 months, 2 weeks ago by Wim Hollebrandse on Wordpress

“Rocket surgery” LOL

4 months, 2 weeks ago by Ryan Farley on Wordpress

© uberVU Ltd. 2010

Terms of use
FEEDBACK