Library

Course: Software Architecture: Dependency Injection for C# Devs

Software Architecture: Dependency Injection for C# Devs

  • Life Time Access
  • Certificate on Completion
  • Access on Android and iOS App
About this Course

Teaching Approach

No fluff, no ranting, no beating the air. I esteem your time. The course material is succinct, yet comprehensive. All the important concepts are covered. Particularly important topics are covered in-depth. For absolute beginners, I offer my help on Skype absolutely free, if requested.

Take this course, and you will be satisfied.

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 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

Who is the target audience?

  • Any C# developer who wants to learn about Dependency Injection and IoC-Frameworks
Basic knowledge
  • Solid experience in C#
What you will learn
  • Apply DIP and use IoC-Containers for Dependency Injection to come up with improved Architecture
Curriculum
Lectures quantity: 52
Common duration: 03:26:18
Dependency Inversion Principle and Dependency Injection
  • Outline  

    The outline of the section dedicated to Dependency Inversion Principle (DIP) and Dependency Injection (DI) where you'll learn the main definitions and concepts.

  • Definition of DIP  

    Learn what is Dependency Inversion Principle (DIP) in essence.

  • Dependencies  

    Learn the definition of a dependency.

  • Volatile and Stable Dependencies  

    Learn the difference between volatile dependencies and stable dependencies.

  • Definitions of IoC and DI  

    Learn what is "inversion of control" and "dependency injection".

  • DIP Violation Demo  

    Look at an example of DIP violation on practice.

  • Refactoring to a Better Design Applying Dependency Injection  

    Look at the refactoring process based on Dependency Injection (DI) that leads to a better design of the application.

  • Dependency Injection Techniques  

    Learn different Dependency Injection (DI) techniques such as Constructor Injection, Property Injection and Method Injection.

  • Architectural Implications  

    Learn about the architectural implications of dependency injection.

  • Common Smells of DIP Violation  

    Learn about the common smells of Dependency Inversion Principle (DIP) violation.

  • Conclusion  

    A conclusion of the section dedicated to Dependency Inversion Principle (DIP) and Dependency Injection (DI). Recap what you learned.

Introduction to IoC-Containers (or DI-Containers)
  • Outline DI-Containers  

    Outline of the second section dedicated to DI-Containers (IoC-Containers).

  • Pure DI and IoC-Containers  

    Learn what is Pure DI and how it differs from IoC-Containers (DI-Containers).

  • Building a Simple IoC-Container  

    Learn how to build your own naive implementation of a DI-Container.

  • Service Locator Design Pattern  

    Learn what is Service Locator and how to implement it. What is the difference between a DI-Container and Service Locator?

  • Demo With an IoC-Container  
  • Conclusion DI-Containers  

    The conclusion for the section on IoC-Containers (DI-Containers). Recap what you learned.

Dependency Injection - Related Anti-Patterns & Refactorings
  • Dependency Injection Related Anti-Patterns & Refactorings - Outline  

    The outline of the third section "Dependency Injection - Related Anti-Patterns & Refactorings". Learn what the most common DI-related anti-patterns exist and how to avoid them or how to remove them by applying proper refactorings.

  • Control Freak  

    Learn about the dependency injection anti-pattern called "Control Freak".

  • Hidden Dependencies with Service Locator  

    Learn about the dependency injection anti-pattern called "Hidden Dependencies" that is caused by wrong use of Service Locator design pattern.

  • Temporal Coupling and Constructor Injection  

    Learn about the dependency injection anti-pattern called "Temporal Coupling" and how to avoid it by applying the constructor injection technique.

  • Constructor Over-Injection  

    Learn about the dependency injection anti-pattern called "Constructor Over-Injection" and how to avoid it by applying corresponding refactorings.

  • Ambient Context  

    Learn the Ambient Context design pattern and how to apply it to avoid the "Constructor Over-Injection" anti-pattern.

  • Facade Service  

    Learn what is Facade Service and how to apply it to avoid constructor over-injection.

  • Property Injection VS Bastard Injection  

    Learn about the dependency injection anti-pattern called "Bastard Injection" and how to cure the decease by applying the property injection.

  • Cyclic Dependencies  

    Learn what is "cyclic dependencies" and why they are pure evil.

  • Dependency Injection Related Anti-Patterns & Refactorings - Conclusion  

    The conclusion on the third section dedicated to DI-related anti-patterns and refactorings.

Dependency Injection Real-World Example
  • Dependency Injection Real-World Example - Outline  

    The outline of the fourth section dedicated to analysis of a real-world code example where we apply Dependency Injection to achieve loosely coupled code.

  • Application Overview  

    An overview of an application we're going to work on.

  • Data Access and Models  

    Overview of the Data Access Layer.

  • UI-Side  

    In this lecture, I'll demonstrate you the UI-side of the sample application.

  • The Problem of Tight Coupling  

    In this lecture, you'll learn about the problem of tight coupling that can be fixed by Dependency Injection.

  • Refactoring Process  

    In this lecture, you'll learn how to refactor the code base towards loosely-coupled code by applying dependency injection.

  • Isolating the Bootstrapper  

    Learn how to isolate the bootstrapper to adhere to the SRP (Single Responsibility Principle).

  • Consequences  

    Learn what are the consequences of refactoing we performed by applying dependency injection.

  • Dependency Injection Real-World Example - Conclusion  

    The conclusion on the refactoring of a real-world example by applying dependency injection to achieve loosely coupled code.

Reaping the Fruits of DI
  • Reaping the Fruits of DI - Outline  

    The outline of the fifth section dedicated to harnessing the pros of loosely-coupled code achieved through Dependency Injection.

  • Adding New DAL  

    In this lecture, I'll show you how to add new data access layer in a loosely-coupled code that was achieved by applying dependency injection.

  • Writing Unit Tests for View Models  

    In this lecture, you'll see how to write a unit test for a view model in a loosely coupled code achieved by applying dependency injection.

  • Reaping the Fruits of DI - Conclusion  

    The conclusion on the section dedicated to harnessing the pros of loosely-coupled code that was achieved by applying dependency injection.

DI-Containers (IoC-Frameworks)
  • DI-Containers (IoC-Containers) - Outline  

    The outline of the sixth section dedicated to DI-Containers (IoC-Containers).

  • Overview of DI-Containers  

    Learn what DI-Containers in the world of .NET platforms exist.

  • Unity DI-Framework  

    Learn how to build a bootstrapper with a Unity DI-Containers.

  • Late Binding with Unity  

    Learn what is late binding and how to implement it with Unity.

  • Aspect-Oriented Programming (AOP)  

    Learn what is Aspect-Oriented Programming or AOP in short.

  • Demonstration of the Problem of Boilerplate Code  

    Look at the problem of the boilerplate code that can be solved by AOP.

  • Implementing AOP by Intercepting  

    Learn how to apply AOP by using the power of Intercepting feature of Unity.

  • Interception vs Pure DI vs AOP Tooling  

    Learn the pros and cons of different approaches to implement AOP.

  • Autofac and Castle.Windsor DI-Containers  

    Learn how to build a bootstrapper with Autofac and Castle.Windsor DI-Containers.

  • Problems Related to DI-Containers  

    Learn what the problems are related to DI-Containers.

  • DI-Containers (IoC-Frameworks) - Conclusion  

    The conclusion on the sixth section dedicated to DI-Containers (IoC-Containers).

  • BONUS Lecture  
Reviews (0)