
Outline the dependency inversion principle and its relation to inversion of control and dependency injection; explore dependencies, refactoring techniques, architectural implications, and building a simple container with a non-trivial example.
Explore the dependency inversion principle by contrasting tight and loose coupling, showing how high level modules depend on abstractions, while details depend on those abstractions to achieve decoupling.
Define dependency types, emphasize how high-level domain objects depend on low-level infrastructure, and show how to decouple via interfaces to enable dependency injection and runtime flexibility.
Compare volatile versus stable dependencies, highlighting environment-driven, under-development, and non-deterministic behavior from databases, external systems, or time and randomness; use indirection and test doubles to enable unit testing.
Define IoC and DI, distinguish inversion of control and dependency inversion principle, and present dependency injection as a technique for loosely coupled code.
Demonstrate a dependency injection violation with a divergence checker tightly coupled to a counter and a fiscal register device, and explain why unit tests fail without proper injection.
Learn how to apply dependency injection to refactor untestable designs by exposing dependencies via constructor, property, or method injection, and verify with unit tests using test doubles.
Explore dependency injection techniques for C# developers, including constructor, method, and property injection, and learn how SRP guides grouping of dependencies and using containers.
Explore how inverting dependencies creates boundaries and plugins around domain logic. See onion/hexagonal and ports-and-adapters architectures and how main sets up dependencies.
Identify common smells of dip violation, including hidden and non deterministic dependencies, and extract a layer of indirection using adapters and test doubles.
Summarizes the core ideas of dependency inversion and injection, explains stable and unstable (volatile) dependencies, and compares constructor, property, and method injection within a ports and adapters architecture.
Compare pure DI and IoC containers. Explore service locator concepts and a real-world DIY container example.
Compare pure DI with IoC containers, highlight the challenges of manual dependency creation, and illustrate how containers recursively resolve dependencies to demonstrate the dependency resolution process.
Build a simple IoC container by registering type mappings, resolving dependencies recursively via reflection, and creating instances through constructors, demoing resolution of a main view model.
Explore the service locator design pattern as a simple IoC container alternative that decouples dependencies from objects, resolves them via a factory method, and contrasts with modern DI containers.
See a practical demo of dependency injection with an IoC container, wiring views and view models through data binding to perform CRUD in a student management app.
Explain why manual dependency injection is poor man's design and how containers compose graphs of objects and manage lifetimes with reflection, noting Service Locator as a precursor.
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
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.
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.
The course covers: