hmlongco / Factory

A new approach to Container-Based Dependency Injection for Swift and SwiftUI.
MIT License
1.83k stars 115 forks source link

What is diffrence between this framework and singleton pattern? #171

Closed Suresh-Vialto closed 10 months ago

Suresh-Vialto commented 10 months ago

This framewrok uses singleton pattern for Container. then how Container is different from singleton.

hmlongco commented 10 months ago

This isn't an issue so should be in discussion. Yes, Factory can be used in a Service Locator pattern, an annotation pattern (@Injected), or you can also simply create a container and pass it along to as needed.

All of which is explained in the README.