Skip to content

Latest commit

 

History

History
66 lines (30 loc) · 1.47 KB

inversion-of-control.md

File metadata and controls

66 lines (30 loc) · 1.47 KB

Inversion of Control. IoC.

Contents at a Glance.

About.

Documentation.

Inversion of Control:

  • Inversion of Control - aka IoC.
  • Is a technique to allow dependencies to be injected at runtime.
  • Dependencies are not predetermined.

Inversion of Control One Important Characteristic.

One important characteristic of a framework is that the methods defined by the user to tailor the framework will often be called from within the framework itself, rather than from the user's application code. The framework often plays the role of the main program in coordinating and sequencing application activity. This inversion of control gives frameworks the power to serve as extensible skeletons. The methods supplied by the user tailor the generic algorithms defined in the framework for a particular application. Ralph Johnson and Brian Foote

IoC vs Dependency Injection:

  • IoC and DI are easily confused
  • DI refers much to the composition of your classes
    • ie - you compose your classes with DI in mind
  • IoC is the runtime environment of your code
    • ie - Spring Framework’s IoC container
    • Spring is in control of the injection of dependencies

Help.