When using a factory your code is still actually responsible for creating objects. By DI you outsource that responsibility to another class or a framework, which is separate from your code.
More Related Contents:
- Using a Strategy and Factory Pattern with Dependency Injection
- Ioc/DI – Why do I have to reference all layers/assemblies in application’s entry point?
- What are the differences between Abstract Factory and Factory design patterns?
- Why not use an IoC container to resolve dependencies for entities/business objects?
- What is a composition root in the context of dependency injection?
- Factory method with DI and IoC
- Is ServiceLocator an anti-pattern?
- Factory Pattern. When to use factory methods?
- What’s the difference between the Dependency Injection and Service Locator patterns?
- Inversion of Control vs Dependency Injection
- Inversion of Control < Dependency Injection [closed]
- Dependency injection through constructors or property setters?
- Can’t combine Factory / DI
- Dependency Injection & Singleton Design pattern
- Avoiding all DI antipatterns for types requiring asynchronous initialization
- How to explain dependency injection to a 5-year-old? [closed]
- When to use PerThreadLifetimeManager?
- When are .NET Core dependency injected instances disposed?
- How to extend a component with dependency injection?
- Meaning of bean discovery mode annotated in CDI 1.1
- What is the difference between Builder Design pattern and Factory Design pattern? [closed]
- Property Injection in ASP.NET Core
- Why is IoC / DI not common in Python?
- Dagger @Reusable scope vs @Singleton
- What is the difference between Factory and Strategy patterns?
- MEF (Managed Extensibility Framework) vs IoC/DI
- ASP.Net Core Call a controller from another controller
- When to use Dependency Injection
- How do I handle classes with static methods with Ninject?
- Windsor castle Injecting properties of constructed object