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. f283ca1ce4b2c39a40fe9add1758f5bb13d3538f/10510324932
Latest Posts