Dependency Injection, the right way

Salle A104, 10:30 - 11:15

  • Microsoft

“Program to an interface, not an implementation” they[1] say …

But when IMyInterface foo = new IMyInterface() is not valid code … how are you supposed to achieve that ? The answer is Dependency Injection.

In this talk, we’ll talk about Dependency injection, what it is and what it is not. We’ll see how it is a valuable set of practices and patterns that help design maintainable software built on top of the SOLID object-oriented principles.

We’ll see how, when used properly, it delivers many benefits such as extensibility and testability … We’ll also cover some anti-patterns, ways of using Dependency Injection that can lead to code that is painful to understand and maintain

This talk is not about DI/IOC containers per se, but focuses on the core concepts of Dependency Injection. Those concepts are essential to understand how to use those “magic-looking” tools (if they are needed at all …)

This talk is not only for .NET developers. It will contain code examples written in C#, but should be understandable by developers with knowledge in other statically-typed object-oriented languages such as Java, Vb.NET, C++ …

[1] Gang of Four - Design Patterns: Elements of Reusable Object-Oriented Software

  • Level: Ha (intermédiaire), Ri (avancé)

  • Topic: Dependency Injection, SOLID principles

Slides, code & other materials provided by speaker

  • Slides
  • Code (GitHub)

About speaker

Thibaud Desodt

Thibaud Desodt

Software Engineer, Direction Générale du Trésor

Thibaud is a French .NET developer living in Belgium. He is currently working for the French Government in a Scrum team based in Brussels, where he builds web applications. He is slightly obsessed with topics such as TDD, object-oriented design the SOLID way and enjoys deleting dead code nearly as much as writing new one. When at home, he spends most of his time taking care of his daughter, playing or listening to music, or reading the internet ... in no particular order.