The intersection of technology and leadership

A Simple Definition: Dependency Injection

A programming concept that focuses on the separation of two concerns; the first being where something comes from, and the other being how it is used.

2 Comments

  1. Rob Wilkerson

    Well said. It strikes me, though, that a key factor in the usefulness of DI is that the latter concern can potentially be influenced by the former (depending on what’s being injected). This is not the case in a traditional delegation scenario.

  2. Richard

    DI is a simple concept of decoupling a class from instantiating all the other classes it needs to do its business. The class can just assume that the other required class instance will just be there when it needs them at runtime. The class creation is done by the framework/container.

    http://www.javasimplified.info/javasimplified/posts/list/3.page

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024 patkua@work

Theme by Anders NorenUp ↑