Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.55 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.55 KB

Dependency Injection

Demo application for my presentation on Dependency Injection at CoderCamp 18 in Hamilton, ON.

The presentation is available here.

Terms

  • Dependency Inversion – A design principal that high level modules should not depend on low level modules, but both should depend on abstractions
  • Inversion of Control – A design pattern where objects are coupled at run-time rather than compile time
  • Dependency Injection – One form of IoC where functionality is passed into an object through constructors or parameters

Advantages

  • Makes adapting to changing requirements easier
  • Makes unit testing much easier
  • New functionality can be plugged in
  • Applications can be composed from smaller modules
  • Promotes loose coupling between modules

Disadvantages

  • Code can be hard to follow
  • Run-time errors instead of compile-time errors
  • Programming to the least common denominator
  • Possible performance issues

Useful Links