singleton

A collection of 1 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Sep 6, 2015 android dagger singleton

True singletons with Dagger 2

I’ve written some time ago about Dagger 2. However, I still don’t understand every nook and cranny. In particular, the @Singleton annotation can be quite misleading as user Zhuiden was kind enough to point out: If you create a new ApplicationComponent each time you inject, you will get a new instance in every place where you inject; and you will not actually have singletons where you expect singletons. An ApplicationComponent should be managed by the Application and made accessibl

Nicolas Fränkel
A Java geek © 2008-2025
v. 121d9fd94c9541658eafe292838e75b380bfc60f/10217422217
Latest Posts