-
-
Notifications
You must be signed in to change notification settings - Fork 153
Benefits over singleton #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems like I had the same question just now 😄 (#88) My question is a bit more concrete than yours → possible answer to your question: |
Main difference to a singleton is that you can easily switch out implementations. Furthermore:
|
Thanks for the explanation! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm wondering what are the benefits of this package over plain simple Dart singletons.
With singletons, you can make an instance of a class available everywhere in your code base, by leveraging the Dart import mechanism (no global variable).
So I'm wondering why would I use get_it. So far, I see that get_it offers a better testability.
It also seems that the laziness would require a bit of boilerplate in singleton, that I wouldn't have to write with get_it
Is there anything else?
The text was updated successfully, but these errors were encountered: