Our school does not support Internet Explorer. For a much better experience, please download the latest version of Google Chrome, Safari, Opera or Firefox
Software Architecture: Dependency Injection for C# Developers

Teachers:

About:

  • 3½ hours
  • 54 lessons
  • 0 quizzes

Certificate of Completion Offered

Build a solid foundation in software architecture applying Dependency Injection with IoC-Containers 

In many of my courses, I use techniques of Dependency Injection and each time students write me private messages saying that they don't what it is and thus they don't understand what's going on in the course I teach. This is very unfortunate from the learning perspectives.

Dependency Injection is the set of techniques that allow to supply dependencies to objects. Actually, if you have ever passed dependencies via constructors, then you applied the so-called constructor injection. Dependency Injection (DI) is simple an

Take this course for $35.00 30 Day Money Back Guarantee
Do you have a coupon?

What You'll Learn In This Course

Apply DIP
Use DI-Containers
Use IoC-Containers
Improve Architecture

What You Need For This Course

Solid experience in CSharp

Description

Build a solid foundation in software architecture applying Dependency Injection with IoC-Containers 

In many of my courses, I use techniques of Dependency Injection and each time students write me private messages saying that they don't what it is and thus they don't understand what's going on in the course I teach. This is very unfortunate from the learning perspectives.

Dependency Injection is the set of techniques that allow to supply dependencies to objects. Actually, if you have ever passed dependencies via constructors, then you applied the so-called constructor injection. Dependency Injection (DI) is simple and difficult at the same time. On one hand, DI is comprised of simple techniques and on the other hand, when we need to bring DI to the next level, we need to make things more complicated using the so-called DI or IoC (Inversion of Control) Containers. These are the frameworks which perform dependency injection automatically. You just need to set one up in the application root (an extremely important notion which you'll learn about in the course) and after that, it will resolve all the dependencies it knows about in the runtime.

If you still don't understand what am I talking about, just believe me, you absolutely need to know about Dependency Injection. This course will tremendously improve your understanding of how software architectures emerge. So, this course is "must watch" for anyone who still doesn't understand what is DI and IoC-Containers.

Content and Overview

This course is aimed at all kind of developers. It provides solid theoretical base reinforced by the practical material.

The course covers:

  • Introduction to Inversion of Control:  
    Dependency Inversion Principle (DIP), Inversion of Control (IoC), Dependency Injection (DI), 
    Dependencies and their types, Pure DI and IoC-Containers, Service Locator 
  • The Architectural Implications of Dependency Injection 
  • DI-related Anti-Patterns & Refactorings:  
    Control Freak, Hidden Dependencies, Temporal Coupling, 
    Constructor Over-Injection and how to avoid it, 
    Ambient Context, Facade Service, Property Injection vs Bastard Injection, Cyclic Dependencies 
  • Refactoring Example of an existing code base applying Dependency Injection 
  • How to reap the fruits of DI 
  • DI-Containers (IoC-Containers): 
    Overview, Unity, Late Binding with Unity, Aspect-Oriented Programming (AOP), Interception vs Pure DI vs AOP Tools, 
  • Setting up a bootstrapper with Unity, Autofac and Castle.Windsor

Syllabus

All the lessons in this course
  • How to Ask Questions
  • How to Ask Question
  • Download Source Code and Slides
  • Dependency Inversion Principle and Dependency Injection
  • Ouline 01:34
  • Definition of DIP 03:31
  • Dependencies 04:13
  • Volatile and Stable Dependencies 02:53
  • Definitions of IoC and DI 03:19
  • DIP Violation Demo 02:25
  • Refactoring to a Better Design Applying Dependency Injection 08:12
  • Dependency Injection Techniques 05:54
  • Architectural Implications 05:24
  • Common Smells of DIP Violation 02:11
  • Conclusion 02:15
  • Introduction to IoC-Containers (or DI-Containers)
  • Outline 01:10
  • Pure DI and IoC-Containers 04:31
  • Building a Simple IoC-Container 03:56
  • Service Locator Design Pattern 02:44
  • Demo With an IoC-Container 10:27
  • Conclusion 01:17
  • Dependency Injection - Related Anti-Patterns & Refactorings
  • Outline 01:57
  • Control Freak 07:23
  • Hidden Dependencies with Service Locator 04:19
  • Temporal Coupling and Constructor Injection 01:48
  • Constructor Over-Injection 04:06
  • Facade Service 02:58
  • Ambient Context 03:39
  • Property Injection VS Bastard Injection 03:34
  • Cyclic Dependencies 11:34
  • Conclusion 02:35
  • Dependency Injection Real-World Example
  • Outline 01:13
  • Application Overview 01:25
  • Data Access and Models 02:00
  • UI-Side 03:19
  • The Problem of Tight Coupling 03:26
  • Refactoring Process 10:38
  • Isolating the Bootstrapper 04:37
  • Consequences 01:54
  • Conclusion 01:14
  • Reaping the Fruits of DI
  • Outline 00:27
  • Adding New DAL 09:04
  • Writing Unit Tests for View Models 10:20
  • Conclusion 00:46
  • DI-Containers (IoC-Frameworks)
  • Outline 01:35
  • Overview of DI-Containers 03:47
  • Unity DI-Framework 10:25
  • Late Binding with Unity 05:30
  • Aspect-Oriented Programming (AOP) 03:50
  • Demonstration of the Problem of Boilerplate Code 04:06
  • Implementing AOP by Intercepting 05:28
  • Interception vs Pure DI vs AOP Tooling 02:40
  • Autofac and Castle.Windsor DI-Containers 04:30
  • Problems Related to DI-Containers 01:58
  • Conclusion 00:57
  • BONUS Lecture