You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
By returning some sort of Provider from Service::factory. This then leaves the dependent class to create an instance using provider.getInstance() or similar.
By returning a constructor. This then leaves the dependent class to create an instance using new ServiceClass()
Both mean that the dependent class has to know that the service is non-singleton and know how to generate/create a new instance. A dependent object shouldn't know or care whether a service it depends on is a Singleton or one of many instances. This is something that should be declarable on the Service / when the service is defined.