Abstract Factory is a very central design pattern for Dependency Injection (DI). Here’s a list of Stack Overflow questions where application of Abstract Factory has been accepted as the solution.
To the best of my understanding, these questions represent real concerns or problems that people had, so that should get you started with some real-life examples:
- Is there a pattern for initializing objects created via a DI container
- Can’t combine Factory / DI
- WCF Dependency injection and abstract factory
- How to set up IoC when a key class needs Session (or other context-specific variable)
- How to Resolve type based on end-user configuration value?
- Strategy Pattern and Dependency Injection using Unity
- Abstract factory pattern on top of IoC?
- Is this the correct way to use and test a class that makes use of the factory pattern?
- DDD Book, Eric Evans: Please explain what is meant by “The FACTORY should be abstracted to the type desired rather than the concrete class(es) created.”
- DI container, factory, or new for ephemeral objects?
- How to unit test instance creation?
- What is the best strategy for Dependency Injection of User Input?