Software Practices

TH21 End-to-End Dependency Injection & Testable Code


3:45pm - 5:00pm

Level: Intermediate

Miguel Castro

Miguel Castro



Melvicorp LLC

Dependency Injection is one of those terms advanced programmers throw out with an expectation and assumption of full understanding. It's easy to get infatuated by a cool buzz phrase, especially when you hear it from so many others. But to truly understand something, you need to understand the problem it's trying to solve. It's important to learn the concepts behind DI so you can write software that can be properly tested. In this session, you'll learn about dependency injection from concept to implementation, and use raw code samples to learn how it works and what problems it solves. You'll see a demonstration of how to write abstracted code to help you test your applications better and determine whether or not use a DI container. Then you'll learn what a DI container is and some of the characteristics and features it offers. Finally, you'll see implementation examples in three different platforms.

You will learn:

  • How to use DI for everything
  • How to completely eliminating class instantiation
  • How to ensure across-the-board testability