Diving Deeper into Dependency Injection
You know the basics of dependency injection (DI). Now it's time to take a closer look at how DI patterns and other design patterns can help us use DI effectively. We'll look at implementations and uses for DI patterns including constructor injection, method injection, and property injection. In addition, we'll use other design patterns to add functionality to existing objects and to manage disposable dependencies. We'll leave with several practical ways to improve the functionality and testing of our code.
Code samples and slides are included in this repository.
Articles and additional resources: http://www.jeremybytes.com/Demos.aspx#MoreDI
DI Patterns
- Dependency Injection: The Property Injection Pattern
- Property Injection: Simple vs. Safe
- Dependency Injection: The Service Locator Pattern
Decorators and Async Interfaces
- Async Interfaces, Decorators, and .NET Standard
- Async Interfaces
- Adding Retry with the Decorator Pattern
- Unit Testing Async Methods
- Adding Exception Logging with the Decorator Pattern
- Adding a Client-Side Cache with the Decorator Pattern
- The Real Power of Decorators -- Stacking Functionality
Challenges
- Static Objects: Mocking Current Time with a Simple Time Provider
Related Topics
- Session: DI Why? Getting a Grip on Dependency Injection
- Pluralsight: Getting Started with Dependency Injection in .NET
More information at http://www.jeremybytes.com